Code example for URL

Methods: getHost, getPort, getProtocol

0
    } 
 
    public static URL getFaviconUrl(URL url) {
        URL result = null;
        try { 
            result = new URL(url.getProtocol(), url.getHost(), url.getPort(),
                "/favicon.ico"); 
        } catch (MalformedURLException e) {
            Log.d(TAG, Log.getStackTraceString(e));
        } 
        return result;
    } 
}