0

I have a ListView, each row have an ImageView to load a small icon. When I scroll down the list, new rows will be load dynamically. But when I scroll up, the old rows just show up which mean all the image in ImageView are cache in the memory right? Now if I scroll down long enough, the memory to store bitmap image will be full and I get Out Of Memory Error. So what's the best way to load Image to ListView in this situation?

EDIT: Is there a way for me to clear all bitmap image in memory when my activity finish?

user1417127
  • 1,525
  • 1
  • 21
  • 29

2 Answers2

1

Use below two link for that, it may help you.

Lazy List

Universal ImageLoader

0

When you are done with showing or setting bitmaps, use bitmap.recycle() and bitmap = null this will help to Garbage Collector to clean memory.

osayilgan
  • 5,873
  • 7
  • 47
  • 68