Skip to content Skip to sidebar Skip to footer

Images In Gridview Get Replaced On Scrolling

I have coded to display few images in gridview. The images are getting displayed from urls. The problem i am facing is that the images get replaced when i scroll.. and the order of

Solution 1:

When you scroll your grid view, image views that are not visible returns to getView() as convertView parameter. But your asyncTask doesn't stop, and call

imageView.setImageDrawable(d);

leads to applying downloaded image to the view on wrong position. Because now you reuse the same imageView. Quick fix is not to use convertView. But it'll slow down your app a bit.

Solution 2:

This seems to be related to convert view. When you reuse the space for an image using convert view then you should use the Imageview within that scope. I would suggest to find the imageview by its id within your current class code and then popultae it.

Post a Comment for "Images In Gridview Get Replaced On Scrolling"