Język

RemoteCallbackList.Builder.SetExecutor(IExecutor) Method

Definition

Sets the executor to be used when invoking callbacks asynchronously. This is only used when callbacks need to be invoked asynchronously, e.g. when the process hosting a callback becomes unfrozen. Callbacks that can be invoked immediately run on the same thread that calls RemoteCallbackList.broadcast(Consumer) synchronously.

[Android.Runtime.Register("setExecutor", "(Ljava/util/concurrent/Executor;)Landroid/os/RemoteCallbackList$Builder;", "", ApiSince=36)]
public Android.OS.RemoteCallbackList.Builder SetExecutor(Java.Util.Concurrent.IExecutor executor);
[<Android.Runtime.Register("setExecutor", "(Ljava/util/concurrent/Executor;)Landroid/os/RemoteCallbackList$Builder;", "", ApiSince=36)>]
member this.SetExecutor : Java.Util.Concurrent.IExecutor -> Android.OS.RemoteCallbackList.Builder

Parameters

executor
IExecutor

This value cannot be null. Callbacks that need asynchronous dispatch use this Executor, providing an easy way to control which thread is used. To dispatch these callbacks through the main thread of your application, you can use MainExecutor. Otherwise, provide an Executor that dispatches to an appropriate thread.

Returns

The returned value is non-null.

Attributes

Remarks

Sets the executor to be used when invoking callbacks asynchronously. This is only used when callbacks need to be invoked asynchronously, e.g. when the process hosting a callback becomes unfrozen. Callbacks that can be invoked immediately run on the same thread that calls RemoteCallbackList.broadcast(Consumer) synchronously.

Java documentation for android.os.RemoteCallbackList.Builder.setExecutor(java.util.concurrent.Executor).

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