Android Universal image loader + Adapter on ListView

446 views Asked by At

I have an ListView contains custom elements with image and progress bar.I use adapter where in function getView() I set image on current element by Universal Image Loader. Logic of app include downloading some info from server after touching on one of my custom element. So after touch downloading starts in own thread and I show the progress Bar on this element. (Under the image). The issue that when user scroll down ListView and then return to the element which now is downloading info from server Universal Image Loader set new copy of element and progress bar doesnt't work there. However downloading still continues in it's thread which behavior is described in necessary copy of class of my element. So how I can show progress bar correctly?

1

There are 1 answers

1
jpelczar On BEST ANSWER

Do you use ViewHolder? This store only one instance of element and doesnt be changed when user scroll down. http://developer.android.com/training/improving-layouts/smooth-scrolling.html