15. Saving and Restoring the State of an Android Activity
If the previous few chapters have achieved their objective, it should now be a little clearer as to the importance of saving and restoring the state of a user interface at particular points in the lifetime of an activity.
In this chapter, we will extend the example application created in “Android Activity State Changes by Example” to demonstrate the steps involved in saving and restoring state when an activity is destroyed and recreated by the runtime system.
A key component of saving and restoring dynamic state involves the use of the Android SDK Bundle class, a topic that will also be covered in this chapter.
15.1 Saving Dynamic State
An activity, as we have already learned, is given ...