Picasso Library, Android: Using Error Listener

后端 未结 6 1544
说谎
说谎 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 06:03

    Picasso 2.0 allows you to attach a callback into a request.

    https://github.com/square/picasso

    The callback you are using is for "global" listener and it helps you debug errors that potentially happen due to a network load.

    Use load(url).into(view, new Callback() {...}); in Picasso 2.0.

    Remember to invoke cancelRequest(target) if you are using a Callback.

提交回复
热议问题