Activity.OnSaveInstanceState Activity.OnSaveInstanceState Method

Definition

Overloads

OnSaveInstanceState(Bundle) OnSaveInstanceState(Bundle)

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

OnSaveInstanceState(Bundle, PersistableBundle) OnSaveInstanceState(Bundle, PersistableBundle)

This is the same as OnSaveInstanceState(Bundle) but is called for activities created with the attribute PersistableMode set to persistAcrossReboots.

OnSaveInstanceState(Bundle) OnSaveInstanceState(Bundle)

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in OnCreate(Bundle) or OnRestoreInstanceState(Bundle) (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);
abstract member OnSaveInstanceState : Android.OS.Bundle -> unit
override this.OnSaveInstanceState : Android.OS.Bundle -> unit

Parameters

outState
Bundle Bundle

Bundle in which to place your saved state.

Remarks

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

OnSaveInstanceState(Bundle, PersistableBundle) OnSaveInstanceState(Bundle, PersistableBundle)

This is the same as OnSaveInstanceState(Bundle) but is called for activities created with the attribute PersistableMode set to persistAcrossReboots.

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

Parameters

outState
Bundle Bundle

Bundle in which to place your saved state.

outPersistentState
PersistableBundle PersistableBundle

State which will be saved across reboots.

Remarks

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