1

I've a problem with Universal Image Loader 1.9.1 on android 4.2.2. The same described here: Android Universal image loader, stop retry. I've read NOSTRA answer multiple times, but I can't figure out how to implement that. Should I extend BaseImageDownloader and override getStream method? I'd like to use the last part of the answer:

UIL doesn't retry image loading itself. If you return null then you'll got onLoadingFailed(...) callback. If you call displayImage(...) for the same URL again then UIL will try to load image again. If you want to prevent it then you should keep "bad" URLs somewhere and not call ImageLoader for these URLs, or return null in ImageDownloader fro these URLs.

Basically, what's the simplest way to avoid UIL trying to contact over and over valid URL's pointing to invalid image files? I don't know if it could be useful, here my config:

DisplayImageOptions options = new DisplayImageOptions.Builder()
        .resetViewBeforeLoading(true).cacheInMemory(true)
        .cacheOnDisc(true)
        .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
        .showImageForEmptyUri(R.drawable.photo_placeholder)
        .showImageOnFail(R.drawable.photo_placeholder).build();

ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
        context).memoryCacheExtraOptions(200, 200)
        .discCacheExtraOptions(200, 200, CompressFormat.JPEG, 75, null)
        .threadPoolSize(5).denyCacheImageMultipleSizesInMemory()
        .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
        .imageDownloader(new BaseImageDownloader(context) {

        })
        .defaultDisplayImageOptions(options).build();

I really need some help here, my app heavily use UIL.

Community
  • 1
  • 1
Jumpa
  • 3,731
  • 9
  • 41
  • 86

1 Answers1

0

As the author of UIL said, UIL doesn't retry image loading itself. There is no need to worry about this

shaobin0604
  • 1,119
  • 12
  • 13