Activity.OnSaveInstanceState Method

Definition

Overloads

OnSaveInstanceState(Bundle)

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in #onCreate or #onRestoreInstanceState (the Bundle populated by this method will be passed to both).

OnSaveInstanceState(Bundle, PersistableBundle)

This is the same as #onSaveInstanceState but is called for activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

OnSaveInstanceState(Bundle)

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in #onCreate or #onRestoreInstanceState (the Bundle populated by this method will be passed to both).

[Android.Runtime.Register("onSaveInstanceState", "(Landroid/os/Bundle;)V", "GetOnSaveInstanceState_Landroid_os_Bundle_Handler")]
protected virtual void OnSaveInstanceState (Android.OS.Bundle outState);
[<Android.Runtime.Register("onSaveInstanceState", "(Landroid/os/Bundle;)V", "GetOnSaveInstanceState_Landroid_os_Bundle_Handler")>]
abstract member OnSaveInstanceState : Android.OS.Bundle -> unit
override this.OnSaveInstanceState : Android.OS.Bundle -> unit

Parameters

outState
Bundle

Bundle in which to place your saved state.

Attributes

Remarks

Java documentation for android.app.Activity.onSaveInstanceState(android.os.Bundle).

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.

See also

Applies to

OnSaveInstanceState(Bundle, PersistableBundle)

This is the same as #onSaveInstanceState but is called for activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

[Android.Runtime.Register("onSaveInstanceState", "(Landroid/os/Bundle;Landroid/os/PersistableBundle;)V", "GetOnSaveInstanceState_Landroid_os_Bundle_Landroid_os_PersistableBundle_Handler")]
public virtual void OnSaveInstanceState (Android.OS.Bundle outState, Android.OS.PersistableBundle outPersistentState);
[<Android.Runtime.Register("onSaveInstanceState", "(Landroid/os/Bundle;Landroid/os/PersistableBundle;)V", "GetOnSaveInstanceState_Landroid_os_Bundle_Landroid_os_PersistableBundle_Handler")>]
abstract member OnSaveInstanceState : Android.OS.Bundle * Android.OS.PersistableBundle -> unit
override this.OnSaveInstanceState : Android.OS.Bundle * Android.OS.PersistableBundle -> unit

Parameters

outState
Bundle

Bundle in which to place your saved state.

outPersistentState
PersistableBundle

State which will be saved across reboots.

Attributes

Remarks

Java documentation for android.app.Activity.onSaveInstanceState(android.os.Bundle, android.os.PersistableBundle).

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.

See also

Applies to