简体   繁体   中英

Check whether Image successfully downloaded or failed

I am using picasso as image loader library in my application. The application will load image from first address (URL1) but if it is failed it will try to download to second address (URL2), is it possible to check download status from picasso library wheter image successfully downloaded or not, so If I failed download image from URL1 I can try to load image from URL2.

thank you.

There is an interface Target in library. You can find it here . It has following 2 methods.

void onError()

Callback indicating the image could not be successfully loaded.

void onSuccess(android.graphics.Bitmap bitmap)

Callback when an image has been successfully loaded.

Try to implement those in your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM