1

I have extended an ArrayAdapter to manage a ListView using a certain tamplate (made of 1 ImageView and 1 TextView contained in a RelativeLayout) as row of the list.

Anyway I am now facing some optimization issues. As you guys know, not all the rows are rendered at any 1 time but rather you get the rows progressively rendered when the user scrolls the list and they actually appear on the screen. Basically my problme is this:

when the list is scrolled really rapidly, the rendering engine cannot keep up with the speed and, although the images to display are cached, the placement of the images in the ImageViews of the visible rows take some time.

To be honest I was expecting the getView method to be really fast but apparently when it comes to images there are some tricks to know. Any1 wanna share ??

cheers ;)

nourdine
  • 7,407
  • 10
  • 46
  • 58
  • it's difficult to guess if you don't provide any details or code of your getView() method... but maybe are you scaling your images in listview? and is this happening only in the emulator or also in a real device? – RoflcoptrException May 25 '10 at 21:06
  • Are you recycling views? Have you checked out the ListView examples in Dev Tools? – HXCaine May 25 '10 at 21:07
  • I am not scaling the images. They are in their natural size. Also I am recycling the views, although I have to say it doesn't make any difference. Maybe is it because I do a findViewById to identify the ImageView I use for the image displacement? I do it all the time som maybe I should save a reference to the ImageView element? – nourdine May 25 '10 at 21:33

1 Answers1

0

You may take a look at my sample. It does exactly the same Lazy load of images in ListView.

Community
  • 1
  • 1
Fedor
  • 43,261
  • 10
  • 79
  • 89