-1

change image on image view when click on next and prev button and image is coming from url.

i have try to change image from below method but this is not changing image.

  imageLoader.displayImage(img[0], imgProperty);

imgProperty is a imageview and img[0] having a url and displayImage is the method of Lazy loading Imagloader class.

Please help me how can change Image view image on click.

enter image description here

Community
  • 1
  • 1
Renu Singh
  • 111
  • 3
  • 10
  • You can use `ViewPager` for it. `img[0]` only will display your first image. For your requirentment you need to take one int variable and compare it with your arraylist. And on next Button click increment that int variable and on prev button click decrement that int variable. – Piyush Nov 14 '14 at 10:04
  • @Piyush Gupta Net and prev button is working fine, we can get incremented url on onclick but we can't change image on image view – Renu Singh Nov 14 '14 at 10:18
  • On your Next-previous button click you also need to load your image in image loader class like imageLoader.displayImage(img[your Integer variable], imgProperty); – Piyush Nov 14 '14 at 10:20
  • i try but image is not changing – Renu Singh Nov 14 '14 at 10:27
  • After click on next Button while you increment your integer variable , then are you passing that variable to your int array?. Here img[incremented int variable]? – Piyush Nov 14 '14 at 10:28
  • yes i am doing like this but did not change image, There is any way to make dynamic multiple image view and load image at same time and change image view on click event – Renu Singh Nov 14 '14 at 11:03
  • Check this link http://www.theappguruz.com/blog/android-image-fragment-pager-view/. This is not for server image. But can get idea from it – Piyush Nov 14 '14 at 11:09

1 Answers1

0

First, make sure img[0] refer to the image's URL.

And use imageLoader.displayImage method instead of imageLoader.DisplayImage (capital D)

Blaze Tama
  • 10,828
  • 13
  • 69
  • 129