Reputation: 21
I created a simple app that has nothing except an EditText element. When I run the app, I type text into the element and then press Ctrl-F11 to change the emulator's orientation. I've added logging information to make sure that the activity gets destroyed and re-created when I change orientation. I haven't added any code to save the text in the EditText element and yet, after the change of orientation, the text that I typed stays in the EditText element. What mechanism in Android is saving and then restoring the element's text (is it savedInstanceState) and how can I see for myself the details of this saving operation?
Upvotes: 0
Views: 557
Reputation: 2548
onSaveInstanceState()/onRestoreInstanceState() along with unique widget IDs. Some links that utilize:
Saving Android Activity state using Save Instance State
http://groups.google.com/group/android-developers/browse_thread/thread/5d7fd8da11c8e971
Upvotes: 1