Android View - What is automatically saved and restored in an Activity

Viewed 12889

I am a beginner with Android.

In Android, some generic elements can be automatically saved/restored in onSaveInstanceState/onRestoreInstanceState.

For example, an EditText saves/restores the Text property, a RatingBar saves/restores the Rating property...

I see from some tests but I can't find anything about this in the documentation.

How can I know what is saved/restored implicitly, without my intervention?

For example, where I can find that the EditText.Text is automatically saved/restored?

I specifically don't want test all properties.


Edit from JRG answer :

https://developer.android.com/guide/components/activities/activity-lifecycle.html

Save your activity state As your activity begins to stop, the system calls the onSaveInstanceState() method<...> The default implementation of this method saves transient information about the state of the activity's view hierarchy, such as the text in an EditText widget or the scroll position of a ListView widget.

How I can know what is the default implementation of save/restore?

Second edit after reread JRG answer :

By default, the system uses the Bundle instance state to save information about >each View object in your activity layout (such as the text value entered into >an EditText widget).

The default implementation saves/restores all state of element view.

2 Answers
Related