I'm working on a tablet app. I tried to set high-resolution (2223x3553) images as background using Layout.setBackgroundResource(ResId)
. The app crashed while testing on Nexus 7
, I won't paste the stack traces since there were like 8 or 9 exceptions with about 300 red lines in the LogCat
and it took me a while to figure out the reason. I got it after I noticed the OutOfMemoryException
, using 1280x800 images the app runs fine but some quality loss has occurred since those images are designed to be high-res.
The question: how to handle high-resolution images in Android to prevent crashes like that? All images are local and stored in the drawable
folder