Lazy Loading GridView


I just added sample code showing one method of lazy loading images in a GridView. I used thread, handler, and the looper classes. It starts by displaying a GridView with a ViewSwitcher that initially displays ProgressBars for each image. Then as the images are sequentially loaded the ViewSwitcher switches to the loaded ImageView.

Check it out here.

Screen shot:
Lazy Loading GridView Example Screen Shot

Lazy Loading GridView Example Screen Shot

Comments 6

  1. Tried your example; which I appreciate. Although If you have a lot of images which are large your example runs out of memory. If you scroll up and down within the GridView the Images never show up.

  2. Thanks for the comment. Have you tried adjusting inSampleSize on the BitmapFactory.Options(located on line 89 in ImageLoader.java)?

  3. Very Good Example But Problem is If i Move the Scroll Bar that time Previous Loading Images is Loading Again.

Leave a Reply

Your email address will not be published. Required fields are marked *