Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    try calling .recycle() on your bitmaps in OnPause(). and load them in onResume() not onCreate(). Commented Jan 16, 2013 at 13:03
  • is it possible to do this in a better way? like, if all my bitmaps are located in a linearlayout, then calling llMain.recycle(), or something like that? Commented Jan 16, 2013 at 13:07
  • You could create an ArrayList<Bitmap> to which you add every bitmap that you load and recycle looping through that. Another general thing: Play with the sample size of the image. Don't know what your app is for but for simply showing the bitmap on the screen most of the time it's still sufficiant to sample them down and save memory. See : developer.android.com/training/displaying-bitmaps/… Commented Jan 16, 2013 at 13:12
  • I also faced this problem and I use How to resolve outofmemory Error ?. I think it will helps you. Commented Jan 16, 2013 at 13:14
  • Is there any chance to get the bitmap out of an imagebutton? Commented Jan 16, 2013 at 15:20