java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android

前端 未结 13 1782
醉话见心
醉话见心 2020-11-22 01:32

I developed an application that uses lots of images on Android.

The app runs once, fills the information on the screen (Layouts, Listviews,

13条回答
  •  旧巷少年郎
    2020-11-22 02:35

    It sounds like you have a memory leak. The problem isn't handling many images, it's that your images aren't getting deallocated when your activity is destroyed.

    It's difficult to say why this is without looking at your code. However, this article has some tips that might help:

    http://android-developers.blogspot.de/2009/01/avoiding-memory-leaks.html

    In particular, using static variables is likely to make things worse, not better. You might need to add code that removes callbacks when your application redraws -- but again, there's not enough information here to say for sure.

提交回复
热议问题