1

Hi I am displaying two textviews and one imageview in a listview in android. I kept a next button in the list header and whenever I click next button, the same page will be called and the texts and image is displayed on that page. All of my images are stored in server. Now I need to get those images from server and display them in listview below the textviews. It is taking more time to display the image from server and so I want to display the image asynchrously. But I didnt get how to use handler and async task in getview method of listview. Help me with this issue.

Will appreciate a lot and will be really thankful....

user1448108
  • 467
  • 2
  • 10
  • 28
  • 1
    [Let me do it for you ?](http://samir-mangroliya.blogspot.in/p/android-image-listview.html)..or... [Also this ?](https://github.com/nostra13/Android-Universal-Image-Loader) – Samir Mangroliya Jun 12 '12 at 17:55
  • @user1448108, he just sent you links to do that....... – dymmeh Jun 12 '12 at 17:59
  • @user1448108 if link suggest by samir is not working then please do us a favor and let us know what do you mean by **asynchronously** – Akram Jun 12 '12 at 18:16

2 Answers2

0

Your on the right track. Asynctask or Handlers are the way to go.

I would probably go with an Asynctask. It's really easy, the onPre and onPost functions run on the UI thread so that's where you update your views. The doInBackground() does not run on the UI so there is where your web service will be called.

You probably should have Googled around for some answers first. http://www.vogella.com/articles/AndroidPerformance/article.html

Frank Sposaro
  • 8,511
  • 4
  • 43
  • 64
0

Check the solution in the following link Android : Loading an image from the Web with Asynctask. Use the solution provided in this post in the getView() of your list adapter.

Community
  • 1
  • 1
Arun George
  • 18,352
  • 4
  • 28
  • 28