Preference.OnSaveInstanceState Method

Definition

Hook allowing a Preference to generate a representation of its internal state that can later be used to create a new instance with that same state.

[Android.Runtime.Register("onSaveInstanceState", "()Landroid/os/Parcelable;", "GetOnSaveInstanceStateHandler")]
protected virtual Android.OS.IParcelable? OnSaveInstanceState ();
[<Android.Runtime.Register("onSaveInstanceState", "()Landroid/os/Parcelable;", "GetOnSaveInstanceStateHandler")>]
abstract member OnSaveInstanceState : unit -> Android.OS.IParcelable
override this.OnSaveInstanceState : unit -> Android.OS.IParcelable

Returns

A Parcelable object containing the current dynamic state of this Preference, or null if there is nothing interesting to save. The default implementation returns null.

Attributes

Remarks

Hook allowing a Preference to generate a representation of its internal state that can later be used to create a new instance with that same state. This state should only contain information that is not persistent or can be reconstructed later.

Java documentation for android.preference.Preference.onSaveInstanceState().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also