I am developing for Froyo on a Nexus One. I have an issue where the dalvik vm crashes (in logcat AndroidRuntime specifically mentions it is shutting down the VM) and brings down running activities and services. My app is a single Activity. onSaveInstanceState is executed when the VM comes down and in there I save some data (an int and two Strings) to the savedInstanceState Bundle. When I start the Activity again, the savedInstanceState Bundle passed to onCreate() is null and onRestoreInstanceState is not called at all. This works perfectly fine when the Activity is destroyed to reclaim memory - just not on a VM crash. How do I preserve information across crashes of this nature?
Thank you,
Jayce
VM's memory is reset when the VM is torn down and started back up.
Save state to persistent storage during onSaveInstanceState(), and if savedInstanceState is null when the activity is coming back up, read in your persisted settings and delete them.