Free Android app covering all aspects of addiction, including prevention and treatment

How to save your Activity’s Instance State

What is Instance State?

ConfigChange iconThe data that is saved by the system to restore the previous state of an activity is called the Instance State. This data is saved as a collection of key/value pairs in a Bundle object.

Same as it ever was: Persisting the Activity state

ActivityState iconWhen an activity is paused or stopped, its state is kept in memory. When the activity resumes, it is restored from memory.

When the activity is destroyed, it loses all information about its state. When the activity is restarted, it is created from scratch. It is a new activity.