Android.App.Activity.OnCreate Method
Called when the activity is starting.

Syntax

[Android.Runtime.Register("onCreate", "(Landroid/os/Bundle;)V", "GetOnCreate_Landroid_os_Bundle_Handler")]
protected virtual void OnCreate (Android.OS.Bundle savedInstanceState)

See Also

Activity.OnStart
Activity.OnSaveInstanceState(Android.OS.Bundle)
Activity.OnRestoreInstanceState(Android.OS.Bundle)
Activity.OnPostCreate(Android.OS.Bundle)

Parameters

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

Remarks

Called when the activity is starting. This is where most initialization should go: calling Activity.SetContentView(int) to inflate the activity's UI, using Activity.FindViewById(int) to programmatically interact with widgets in the UI, calling Activity.ManagedQuery(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[]) to retrieve cursors for data being displayed, etc.

You can call Activity.Finish from within this function, in which case onDestroy() will be immediately called without any of the rest of the activity lifecycle (Activity.OnStart, Activity.OnResume, Activity.OnPause, etc) executing.

Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1