Activity.RegisterScreenCaptureCallback Method

Definition

Registers a screen capture callback for this activity.

[Android.Runtime.Register("registerScreenCaptureCallback", "(Ljava/util/concurrent/Executor;Landroid/app/Activity$ScreenCaptureCallback;)V", "GetRegisterScreenCaptureCallback_Ljava_util_concurrent_Executor_Landroid_app_Activity_ScreenCaptureCallback_Handler", ApiSince=34)]
[Android.Runtime.RequiresPermission("android.permission.DETECT_SCREEN_CAPTURE")]
public virtual void RegisterScreenCaptureCallback(Java.Util.Concurrent.IExecutor executor, Android.App.Activity.IScreenCaptureCallback callback);
[<Android.Runtime.Register("registerScreenCaptureCallback", "(Ljava/util/concurrent/Executor;Landroid/app/Activity$ScreenCaptureCallback;)V", "GetRegisterScreenCaptureCallback_Ljava_util_concurrent_Executor_Landroid_app_Activity_ScreenCaptureCallback_Handler", ApiSince=34)>]
[<Android.Runtime.RequiresPermission("android.permission.DETECT_SCREEN_CAPTURE")>]
abstract member RegisterScreenCaptureCallback : Java.Util.Concurrent.IExecutor * Android.App.Activity.IScreenCaptureCallback -> unit
override this.RegisterScreenCaptureCallback : Java.Util.Concurrent.IExecutor * Android.App.Activity.IScreenCaptureCallback -> unit

Parameters

executor
IExecutor

Executor: This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

callback
Activity.IScreenCaptureCallback

Activity.ScreenCaptureCallback: This value cannot be null.

Attributes

Remarks

Registers a screen capture callback for this activity. The callback will be triggered when a screen capture of this activity is attempted. This callback will be executed on the thread of the passed executor. For details, see ScreenCaptureCallback.onScreenCaptured. Requires Manifest.permission.DETECT_SCREEN_CAPTURE

Android reference for android.app.Activity.registerScreenCaptureCallback.

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