Share via


ISdkSandboxActivityHandler.OnActivityCreated(Activity) Method

Definition

Notifies SDK when an Activity gets created.

[Android.Runtime.Register("onActivityCreated", "(Landroid/app/Activity;)V", "GetOnActivityCreated_Landroid_app_Activity_Handler:Android.App.SdkSandbox.SdkProvider.ISdkSandboxActivityHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)]
public void OnActivityCreated (Android.App.Activity activity);
[<Android.Runtime.Register("onActivityCreated", "(Landroid/app/Activity;)V", "GetOnActivityCreated_Landroid_app_Activity_Handler:Android.App.SdkSandbox.SdkProvider.ISdkSandboxActivityHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)>]
abstract member OnActivityCreated : Android.App.Activity -> unit

Parameters

activity
Activity

the Activity gets created

Attributes

Remarks

Notifies SDK when an Activity gets created.

This function is called synchronously from the main thread of the Activity that is getting created.

SDK is expected to call Activity#setContentView(View) to the passed Activity object to populate the view.

If SDK registers lifecycle callbacks over the passed Activity object using Activity#registerActivityLifecycleCallbacks( android.app.Application.ActivityLifecycleCallbacks), it is important to note that android.app.Application.ActivityLifecycleCallbacks#onActivityPreCreated(Activity, Bundle) and android.app.Application.ActivityLifecycleCallbacks#onActivityCreated(Activity, Bundle) will not be triggered as #onActivityCreated(Activity) is called at the Activity creation stage. Then to know about the Activity state, SDKs should override android.app.Application.ActivityLifecycleCallbacks#onActivityPostCreated(Activity, Bundle).

Java documentation for android.app.sdksandbox.sdkprovider.SdkSandboxActivityHandler.onActivityCreated(android.app.Activity).

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