Changes

Jump to: navigation, search
Saving Dynamic State
== Saving Dynamic State ==
<google>ADSDAQBOX_FLOW</google>
So far in this example, no steps have been taken to save the dynamic state of the activity. Although appropriate methods have been overridden, no code other than a log output has been implemented. The importance of implementing this functionality can be demonstrated using the example application. With the device in portrait orientation and the activity in the foreground, touch inside the EditText field and enter some new text into the box. Make a mental note of the change made to the text before rotating the device into landscape orientation. As should be evident, the changes made to the text have been lost. This is, quite simply, because no steps have been taken to ensure that state is saved and restored in the event that the activity is destroyed and recreated. This will be the focus of the next chapter, entitled Saving and Restoring the User Interface State of an Android Activity.

Navigation menu