It seems to me like Android has a Memory Leak Bug with Background Images loaded from XML resources.
Lets put up the following setup: A clean new Android 1.5 SDK Project with only one Activity containing this:
And an XML layout "main" just containing this:
As seen I am using a 1mb Image resource for my layouts background.
If you start the App, turn the Orientation two times it will crash with the following error:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
cause by the Inflation of the XML file.
The only way I can stop the app from crashing.. and leaking memory is getting the background drawable, setting the callback of it to null AND then setting the Layouts backgrounddrawable to null...
This really looks like a Bug to me... and a pretty bad Bug!!
Anny comments? Am I missing something?