ahmad
ahmad

Reputation: 2209

Universal Image Loader - Image URL 404 Error handling

I am trying to use the Android Universal Image Loader library to download images from a URL from the web. However, the URLs can return a 404 error because the picture sometimes hasn't been uploaded by the company. How do I handle this? I tried using the following but it had no effect:

DisplayImageOoptions options = new DisplayImageOptions.Builder()
  .cacheInMemory()
  .showImageForEmptyUri(R.drawable.no_image)
  .build();

Can someone please help me out and point me in the right direction? I would appreciate it very much.

Upvotes: 1

Views: 750

Answers (1)

Shamim Ahmmed
Shamim Ahmmed

Reputation: 8383

You could try to use:

DisplayImageOoptions options = new    DisplayImageOptions.Builder().
cacheInMemory().
showImageOnFail(R.drawable.no_image).
showImageForEmptyUri(R.drawable.no_image).
build();

Upvotes: 1

Related Questions