Activity.OnSaveInstanceState Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| OnSaveInstanceState(Bundle) |
Called to retrieve per-instance state from an activity before being killed
so that the state can be restored in |
| OnSaveInstanceState(Bundle, PersistableBundle) |
This is the same as |
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
<code>persistAcrossReboots</code>.
[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
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)
- OnCreate(Bundle)
- <xref:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle%2c+Android.OS.PersistableBundle)>
- OnPause()