SdkSandboxActivityHandler
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 android.app.sdksandbox.sdkprovider.SdkSandboxController#registerSdkSandboxActivityHandler(android.app.sdksandbox.sdkprovider.SdkSandboxActivityHandler)
that will return an android.os.IBinder
identifier for the registered SdkSandboxActivityHandler
to The SDK.
The SDK should be notified about the Activity
creation by calling android.app.sdksandbox.sdkprovider.SdkSandboxActivityHandler#onActivityCreated(android.app.Activity)
which happens when the caller app calls android.app.sdksandbox.SdkSandboxManager#startSdkSandboxActivity(Activity, IBinder)
using the same IBinder
identifier for the registered SdkSandboxActivityHandler
.
Summary
Public methods | |
---|---|
abstract Unit |
onActivityCreated(activity: Activity) Notifies SDK when an |
Public methods
onActivityCreated
abstract fun onActivityCreated(activity: Activity): Unit
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 android.app.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(android.app.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)
.
Parameters | |
---|---|
activity |
Activity: the Activity gets created This value cannot be null . |