Instrumentation.OnCreate(Bundle) Method

Definition

Called when the instrumentation is starting, before any application code has been loaded.

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

Parameters

arguments
Bundle

Any additional arguments that were supplied when the instrumentation was started.

Attributes

Remarks

Called when the instrumentation is starting, before any application code has been loaded. Usually this will be implemented to simply call #start to begin the instrumentation thread, which will then continue execution in #onStart.

If you do not need your own thread -- that is you are writing your instrumentation to be completely asynchronous (returning to the event loop so that the application can run), you can simply begin your instrumentation here, for example call Context#startActivity to begin the appropriate first activity of the application.

Java documentation for android.app.Instrumentation.onCreate(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.

Applies to