Skip to content Skip to sidebar Skip to footer

Out Of Memory Exception In Android When Adding Some Image Buttons

I have written a small Android project that shows some (image)buttons. It works fine on my phone ( Galaxy S ), but when I try to run it on emulator, it gives the following error: C

Solution 1:

Your running low on memory, and the best way to remedy that will be to use less memory, loading smaller images will help a great deal here, and googles android team have been kind enough to put up a short description on how to do this :)

http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

Solution 2:

How big are the files that define the buttons (file size, not image dimensions)? It seems like those are just much too big. Android needs to load them all at once into main memory in order to display them.

For my app, all those files are in the 0.5~2kB range

Post a Comment for "Out Of Memory Exception In Android When Adding Some Image Buttons"