With the Android 2.2 update came a new car dock app. If my app is in the foreground when I dock my phone, my app gets killed or paused or something, and when I try to re-open my app, it's all messed up. It has lost its state information.
Does anybody know what the car dock app is doing? At very least, it seems to be force killing all running applications or some other destructive behavior.
I guess once we identify what it is doing, I'll be able to go about coding around it.
All apps lose their state when they're killed. In fact, they lose their information when you change the orientation, unless you specifically save it (say, in onSaveInstanceState).
If you want your information to be so persistent that it can survive an app switch (or system reset), you can save your state in the SharedPreferences instead of the bundle you get in onSaveInstanceState.
How do you currently save your state? Do you do that at all?
Btw, you can also add a broadcast receiver to listen for ACTION_DOCK_EVENT and check the state for EXTRA_DOCK_STATE_CAR and save your instance data, in case you don't like the general SharedPreferences idea.