Language

VoiceInteractionSession.RegisterVisibleActivityCallback Method

Definition

Registers a callback that will be notified when visible activities have been changed.

[Android.Runtime.Register("registerVisibleActivityCallback", "(Ljava/util/concurrent/Executor;Landroid/service/voice/VoiceInteractionSession$VisibleActivityCallback;)V", "", ApiSince=32)]
public void RegisterVisibleActivityCallback(Java.Util.Concurrent.IExecutor executor, Android.Service.Voice.VoiceInteractionSession.IVisibleActivityCallback callback);
[<Android.Runtime.Register("registerVisibleActivityCallback", "(Ljava/util/concurrent/Executor;Landroid/service/voice/VoiceInteractionSession$VisibleActivityCallback;)V", "", ApiSince=32)>]
member this.RegisterVisibleActivityCallback : Java.Util.Concurrent.IExecutor * Android.Service.Voice.VoiceInteractionSession.IVisibleActivityCallback -> unit

Parameters

executor
IExecutor

The executor which will be used to invoke the callback. 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
VoiceInteractionSession.IVisibleActivityCallback

The callback to receive the response. This value cannot be null.

Attributes

Remarks

Registration is posted to the session's handler, and notifications run on the supplied executor. A newly registered callback receives information about currently visible activities. Registering the same callback again does not change its executor or register it twice.

Call after OnCreate, when the session token is available. The executor and callback must not be null.

Android reference for android.service.voice.VoiceInteractionSession.registerVisibleActivityCallback.

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