When is onSaveInstanceState called and how can I use the save variables in the bundle? In my experiment, this is what I observed:
When the application is running is foreground, pressing the Home key resulted in: onSaveInstanceState onPause onStop Clicking the application icon again (i.e. bring it back to foreground) resulted in: onRestart onStart onResume With the application now in the foreground, pressing the Back key resulted in: onPause onStop onDestroy Note the onSaveInstanceState is NOT getting called when Back key is pressed. How does one then save and restore the application state when the Back key is pressed and then the application is brought to foreground? Clicking the application icon again (i.e. bring it back to foreground) resulted in: onCreate LocationActivity onStart LocationActivity onResume The Bundle value in onCreate is null (perhaps because onSaveInstanceState was not called when Back was clicked. And onRestoreInstanceState was never called either. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---