I have an Android game that has an activity for the menu, and then another activity for the game that creates a SurfaceView and Thread to deal with canvas drawing and game logic. When you exit the game and start it up again too much or if you open and close the keyboard (thus restarting the activity), the game runs out of memory, usually when loading a bitmap:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
How can I keep all my images in memory without loading them again when the game changes state, or how can I release them from memory and let them reload when the game is restarted?