If you finish your activity, that instance is gone, so you won't get the instance state. onSaveInstanceState is for restoring the activity to its previous state after the user leaves it (WITHOUT finishing it) and later returns and it needs to be restarted. Or if the configuration changes (rotation, keyboard visibility, locale, etc) so the current activity instance needs to be restarted from its saved state.
On Thu, Aug 20, 2009 at 9:12 AM, chandlersong <[email protected]> wrote: > > protected void onSaveInstanceState(Bundle outState) { > super.onSaveInstanceState(outState); > outState.putStringArrayList("history", > this.history); > > } > > it's my code.and this.history is an arraylist.I hope I can get > it at OnCreate method next time. but it doesn't work. > I search and find that the method works only when it’s not > being explicitly finished.Does it ture? It's mean I have to find > another way to restore the arraylist if the app finished explicitly? > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

