1

I am using GridView in my app. The images for gridview are

  1. I download them from network.
  2. Downscale them to required size.
  3. Write them to file,

All 3 steps are done using AsyncTask. Then I update UI. Next time when I open GridView, I simply decode it from sdcard. The image count is around 15. When I do memeinfo dumpsys on my app, my heap size keeps growing from 12 to 50. My question is , will gridview automatically recycle the bitmaps passed in adapter or we have to do for it. I get OutOfMemoryException.I see many links how to handle bitmaps efficiently including android link and I have implemented them in my app but no link explains bitmap recycle in gridview.Please help me.

user1479604
  • 117
  • 1
  • 3
  • 12
  • You should cache the images http://stackoverflow.com/a/12819091/726863 – Lalit Poptani Nov 19 '12 at 08:05
  • You should use Lazy Adapter for this.. http://www.technotalkative.com/android-asynchronous-image-loading-in-listview/ go through this link .. you will get a solution. – itsrajesh4uguys Nov 19 '12 at 08:07
  • use MAT to see memory those memory retentions – auselen Nov 19 '12 at 08:08
  • 1
    Yeah I am caching images. And caching is working fine. Problem is say i load 10 bitmaps into gridview and now i press back button of my app, who should recycle the bitmaps that i loaded into memory ?? – user1479604 Nov 19 '12 at 08:09

0 Answers0