Reputation: 1
How do you save an instance state of an activity. For instance a user opens up a application and clicks a button. A new view is formed and the user types in some information and moves to the next screen in that activity. After that goes back to the main menu of the app. how do you save where the state was before the user went back to the main menu.
Thanks in advance everyone!
Upvotes: 0
Views: 2053
Reputation: 25761
http://developer.android.com/reference/android/app/Activity.html
In addition, the method onSaveInstanceState(Bundle) is called before placing the activity in such a background state, allowing you to save away any dynamic instance state in your activity into the given Bundle, to be later received in onCreate(Bundle) if the activity needs to be re-created.
Upvotes: 2