Reputation: 425
I was experiencing a memory leak problem with one of my apps, and after many hours, I instead decided to create a new project as a dumbed down version of the app:
ImageView
s with src and formatting. The code listens for clicks on one of those and opens a new activity (second activity).ImageView
s and 2 EditText
s. The .java
does nothingdrawable
The problem:
ImageView
gives an OOM exception.More Details:
byte[]
loaded by <system class loader>
I've spent all day on this, and created countless new projects just to test it, and I'm still lost. I know most people can't provide an answer based on the given information, but if you can tell me the next steps, or some things to try to figure out the problem, that counts as an answer too.
Upvotes: 1
Views: 116
Reputation: 6707
Add in your AppManifest.xml in your application tag this code:
android:largeHeap="true"
This will try to prevent your app from causing OutOfMemoryError.
Documentation: http://developer.android.com/guide/topics/manifest/application-element.html#largeHeap
Although this is not a very recommended solution, it should still work...
You can also try to decrease your images' resolution if they are so large.
If problem still persists, I highly recommend to check this link: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html#load-bitmap
Upvotes: 1