Picasso Library, Android: Using Error Listener

后端 未结 6 1541
说谎
说谎 2020-11-29 05:11

I\'m playing around with the Picasso library for image loading, but I\'m running into an issue. When an image fails to load, I want to hide the view rather than load in a de

6条回答
  •  时光取名叫无心
    2020-11-29 05:58

    My example:

    Picasso picasso = new Picasso.Builder(parent.getContext())
                .listener(new Picasso.Listener() {
                    @Override
                    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
                    //Here your log
                    }
                })
                .build();
        picasso.load(shopModel.getShopImg())
                .fit()
                .into(viewHolder.shopImg);
    

提交回复
热议问题