Search code examples
androidpicassofavicon

how to use Picasso to load favicon.ico icon in android app


using picasso to load image from remote url, it works fine except if the image is favicon.ico

is it the picasso does not handle favico type of file?

favIconUrl = "http://www.cnn.com/favicon.ico";

  Picasso.with(mContext)
         .load(favIconUrl)
         .into(target);

Solution

  • did trace, looks like picasso does not handle it:

    Picasso picasso = new Picasso.Builder(mContext).listener(new Picasso.Listener() {
        @Override
        public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
    
             Log.i("onImageLoadFailed(), uri:"+uri+", exception:"+exception);
                                                }
         }).build();
    

    onImageLoadFailed(), uri:https://www.yahoo.com/favicon.ico, exception:java.io.IOException: Failed to decode stream.