-2

How to show place holder and error image from web URL in NetworkImageView in Volley library. I want to show placeholder and error image from web url following below steps:

  1. check in cache for placeholder image
  2. if found then show that in imageview
  3. else download placeholder image from web url
  4. then show at imageview
MohdTausif
  • 498
  • 4
  • 13
  • 1
    why don't you use Picasso ? – Zahidul Islam May 26 '16 at 07:30
  • you can use ImageLoader for NetworkImageView and apply placeholder and error image on this ImageLoader. – Abhishek Patel May 26 '16 at 07:31
  • Possible duplicate of [display NetworkImageView's default image without network request](http://stackoverflow.com/questions/21567055/display-networkimageviews-default-image-without-network-request) – Hitesh Sahu May 26 '16 at 07:52
  • I want to display place holder image from a web url (after download from web), I dont want to bundle placeholder image in apk's drawable. – MohdTausif May 26 '16 at 09:14
  • Please consider taking a look at stackoverflow.com/help for information on how to improve your question. It looks like you haven't done any research on the subject. – Olga May 26 '16 at 09:41

1 Answers1

3

Please Try like this

ImageLoader imageLoader = AppController.getInstance().getImageLoader();
imageLoader.get("your image path", ImageLoader.getImageListener(
            imgNetWorkView, R.drawable.ico_loading, R.drawable.ico_error));
imgNetWorkView.setImageUrl("your image path", imageLoader);
Abhishek Patel
  • 4,280
  • 1
  • 24
  • 38