This application has MainActivity and it uses about 20 bitmaps. It works pretty fine but when I start an intent to another activity and then go back to the MainActivity, it crashes because of memory problem. It gives this error:
java.lang.OutOfMemoryError: Failed to allocate a 2052108 byte allocation with 1629176 free bytes and 1590KB until OOM
I have also used these in the manifest
android:hardwareAccelerated="false"
android:largeHeap="true"
What would be the best method to be able to switch between Activities without using more memory? Thanks
当不再使用时,您只需回收位图
myBitmap.recycle();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.