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?
            Asked
            
        
        
            Active
            
        
            Viewed 555 times
        
    1 Answers
1
            
            
        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
- 
                    Is there a simple example demonstrating the need to explicitly save information in the onPause() method? I've even tried doing "kill -9" to a process, and onSaveInstanceState() still seemed to be called automatically. When will not doing explicit saving inside the onPause() method cause trouble, and how can I make this happen in an example on the emulator? – hwexler2 Feb 13 '11 at 20:11
 
     
    