Activity.OnCreate Activity.OnCreate Method

Definition

Overloads

OnCreate(Bundle) OnCreate(Bundle)

Called when the activity is starting.

OnCreate(Bundle, PersistableBundle) OnCreate(Bundle, PersistableBundle)

Same as OnCreate(Bundle) but called for those activities created with the attribute PersistableMode set to persistAcrossReboots.

OnCreate(Bundle) OnCreate(Bundle)

Called when the activity is starting.

[Android.Runtime.Register("onCreate", "(Landroid/os/Bundle;)V", "GetOnCreate_Landroid_os_Bundle_Handler")]
protected virtual void OnCreate (Android.OS.Bundle savedInstanceState);
abstract member OnCreate : Android.OS.Bundle -> unit
override this.OnCreate : Android.OS.Bundle -> unit

Parameters

savedInstanceState
Bundle Bundle

If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in OnSaveInstanceState(Bundle). Note: Otherwise it is null.

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

OnCreate(Bundle, PersistableBundle) OnCreate(Bundle, PersistableBundle)

Same as OnCreate(Bundle) but called for those activities created with the attribute PersistableMode set to persistAcrossReboots.

[Android.Runtime.Register("onCreate", "(Landroid/os/Bundle;Landroid/os/PersistableBundle;)V", "GetOnCreate_Landroid_os_Bundle_Landroid_os_PersistableBundle_Handler", ApiSince=21)]
public virtual void OnCreate (Android.OS.Bundle savedInstanceState, Android.OS.PersistableBundle persistentState);
abstract member OnCreate : Android.OS.Bundle * Android.OS.PersistableBundle -> unit
override this.OnCreate : Android.OS.Bundle * Android.OS.PersistableBundle -> unit

Parameters

savedInstanceState
Bundle Bundle

if the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in OnSaveInstanceState(Bundle). Note: Otherwise it is null.

persistentState
PersistableBundle PersistableBundle

if the activity is being re-initialized after previously being shut down or powered off then this Bundle contains the data it most recently supplied to outPersistentState in OnSaveInstanceState(Bundle). Note: Otherwise it is null.

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