Język

ActivityManager.AppTask.RequestWindowingLayer Method

Definition

Requests the windowing layer for this task.

[Android.Runtime.Register("requestWindowingLayer", "(ILjava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetRequestWindowingLayer_ILjava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=37)]
public virtual void RequestWindowingLayer(int layer, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("requestWindowingLayer", "(ILjava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetRequestWindowingLayer_ILjava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=37)>]
abstract member RequestWindowingLayer : int * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.RequestWindowingLayer : int * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

layer
Int32

The WindowingLayer to move the task to.

executor
IExecutor

An Executor used to invoke the callback.

callback
IOutcomeReceiver

A callback to receive the result of the request.

Attributes

Remarks

Requests the windowing layer for this task. This can be used to affect the Z-ordering of the activity's window relative to other windows.

The task will be moved to the requested layer if possible. When the request is approved or rejected, the callback will be invoked. If rejected, the callback will receive an exception with a descriptive message accessible via Exception.getMessage().

If the request is rejected due to a system state, the callback will receive AppTask.WINDOWING_LAYER_REQUEST_REJECTED. If the request is granted, the callback will receive AppTask.WINDOWING_LAYER_REQUEST_GRANTED.

To ensure system integrity and a consistent user experience, the system might impose restrictions on tasks requesting a specific layer. See AppTask.WINDOWING_LAYER_PINNED for implications when requesting the pinned layer.

If AppTask.WINDOWING_LAYER_PINNED is requested, AppOpsManager.OPSTR_PICTURE_IN_PICTURE must be allowed and the Manifest.permission.USE_PINNED_WINDOWING_LAYER permission must be granted.

If the request fails due to a developer error (such as missing permissions or invalid arguments), OutcomeReceiver.onError will be invoked with a Exception describing the error.

Android reference for android.app.ActivityManager.AppTask.requestWindowingLayer.

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