Get default favicon : Icon « 2D Graphics « Android






Get default favicon

 

import java.net.MalformedURLException;
import java.net.URL;

import android.util.Log;

class Main {
  public URL getDefaultFavicon(String rssurl) {
    try {
      URL orig = new URL(rssurl);

      URL iconUrl = new URL(orig.getProtocol(), orig.getHost(),
          orig.getPort(), "/favicon.ico");

      return iconUrl;
    } catch (MalformedURLException e) {
      Log.d("", Log.getStackTraceString(e));
      return null;
    }
  }
}

   
  








Related examples in the same category

1.Load png Icon file with xml layout
2.Using Image icon as the background resource
3.extends ArrayAdapter to create Icon adapter
4.Shows a list that can be filtered in-place with a SearchView in non-iconified mode.
5.create Icon Thumbnail, Scaled Image
6.create Icon Thumbnail