UrlImageViewCallback : called only when when image loading is successfull

904 views Asked by At

I am using the amazing UrlImageViewHelper library from koush https://github.com/koush/UrlImageViewHelper

The problem that I am currently facing is that the helper only notify when an iMage is succesfully loaded, according to the callback documentation:

callback An instance of UrlImageViewCallback that is called when the image successfully finishes loading. This value can be null.

UrlImageViewCallback myCallback = new UrlImageViewCallback() {
    @Override
    public void onLoaded(ImageView imageView, Drawable loadedDrawable,
            String url, boolean loadedFromCache) {

I just wanted to know how it would be possible to be notified when an ImageView is not loaded. (server didn't answer, or wrong url)

Thank a lot for any help.

1

There are 1 answers

2
Waza_Be On BEST ANSWER

Sounds like I had to create my own callback:

public interface UrlImageViewCallback {
    void onLoaded(ImageView imageView, Drawable loadedDrawable, String url, boolean loadedFromCache);
    void onFail(ImageView imageView, String url);
}

Working fine now.