Richard, If you save something into the bundle and hit 'home' (button with a house on it), the system will always return a non-null Bundle to you. If you don't save anything to the Bundle, I'm not sure what the system will do.
If you hit the 'back' button (button with the arrow), the system will not call onSaveInstanceState and therefore give a null Bundle to onCreate. The other thing that comes to mind is that if you're trying to tweak launch modes, the system may be launching a new instance of your Activity, which it would launch with a null Bundle. If this is the case, hitting the 'back' button should eventually reveal another instance of your same Activity. Its also worth noting that onPause is *not* always followed by onCreate (), it may be followed by onResume or onStop. onStop may then be followed by onRestart, followed by onStart. If the system is improperly discarding state, this would be the first time I've seen it, but its not impossible. Cheers, Justin Android Team @ Google On Dec 15, 9:32 am, jarkman <[email protected]> wrote: > I'm a bit confused by the saved instance state mechanism. > > If I breakpoint in onCreate, run the app, hit the Home button, then > relaunch the app, I typically see a null Bundle passed in to > onCreate. > > But, if I (for example) rotate the emulator, I see a non-null Bundle > in onCreate, and the app has the right state after the rotation. > > What causes the null in the first example ? It looks as though the > system has thrown away the saved instance state on our behalf. > > Thanks, > > Richard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

