0

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.

Waza_Be
  • 39,407
  • 49
  • 186
  • 260

1 Answers1

0

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.

Waza_Be
  • 39,407
  • 49
  • 186
  • 260
  • Can i know how to set this callback for the image view ? – user1340801 Jul 17 '13 at 12:24
  • Thanks to this change https://github.com/koush/UrlImageViewHelper/commit/50322a6475344c597c7fc63856d6a556d81d066a you will receive a null in onLoaded callback. – Waza_Be Jul 17 '13 at 13:02