Firstly, I know that there are many related posts, I read a lot of them, none of them helped, and I have no ideas :)
So, I am developing an Android application (sdk version 14+) that uses a lot of images (for buttons, logos, displaying a large number of images, etc.). The average image size is 120kb + - 100kb
As the header says, I get an OutOfMemory error. First I added the image source to ImageViews in xml or programmatically using setImageResource. Soon, the application started crashing due to an OutOfMemory error. So I read this ( http://developer.android.com/reference/android/util/LruCache.html ) and implemented LruCache as it says. I added bitmaps to lrucache and then used the get method to set the bitmap to imageview.
In the onDestroy method, I call the evictAll method on lrucache, and I set lrucache to null. Therefore, I assume that memory is freed.
However, the problem still persists, when I look through a couple of actions, the application crashes.
Help evaluate!)
user1788084
source
share