SdkSandboxActivityHandler


public interface SdkSandboxActivityHandler

android.app.sdksandbox.sdkprovider.SdkSandboxActivityHandler


This is used to notify the SDK when an Activity is created for it.

When an SDK wants to start an Activity, it should register an implementation of this class by calling SdkSandboxController.registerSdkSandboxActivityHandler(android.app.sdksandbox.sdkprovider.SdkSandboxActivityHandler) that will return an IBinder identifier for the registered SdkSandboxActivityHandler to The SDK.

The SDK should be notified about the Activity creation by calling onActivityCreated(android.app.Activity) which happens when the caller app calls SdkSandboxManager.startSdkSandboxActivity(Activity, IBinder) using the same IBinder identifier for the registered SdkSandboxActivityHandler.

Summary

Public methods

abstract void onActivityCreated(Activity activity)

Notifies SDK when an Activity gets created.

Public methods

onActivityCreated

public abstract void onActivityCreated (Activity activity)

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 Application.ActivityLifecycleCallbacks.onActivityPreCreated(Activity, Bundle) and Application.ActivityLifecycleCallbacks.onActivityCreated(Activity, Bundle) will not be triggered as onActivityCreated(android.app.Activity) is called at the Activity creation stage. Then to know about the Activity state, SDKs should override Application.ActivityLifecycleCallbacks.onActivityPostCreated(Activity, Bundle).

Parameters
activity Activity: the Activity gets created This value cannot be null.