4

This is a follow-up question to android gridview crashes on Galaxy 3 I fixed some stuff, and now I get the gridView to load. I have many images in the gridView, so I need to scroll down to see al of them. If I scroll down slowly, everything seems to be ok. But if I scroll down fast, the app crashes with OutOfMemory error. So, Iassume that the views that are nolonger visible, take time to be deleted. Is there a fast way to manually delete them and prevent this from happening? You can see all the gridView code in this
question (and if you can answer it too, it will be great)

Community
  • 1
  • 1
n00b programmer
  • 2,671
  • 7
  • 41
  • 56
  • First, make sure the small thumbnails are really small. second, try generating the bitmaps for all your thumbnails in advance and using setImageBitmap() instead. – Steelight Jul 16 '12 at 11:18

1 Answers1

0

Because when u scrolling your gridview then getView() method call using adapter.This method is responsible for set image but due to poor performance of server image not make at a time for set in this view thats why outofmemory error occures.

Use this example in your code Android: Help in adapting ListView adapter with an ImageLoader Class (LazyList).

Its should help for you.

Community
  • 1
  • 1
Rishabh Agrawal
  • 861
  • 2
  • 15
  • 25