Condividi tramite


Activity.OnPerformDirectAction Method

Definition

This is called to perform an action previously defined by the app.

[Android.Runtime.Register("onPerformDirectAction", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;Ljava/util/function/Consumer;)V", "GetOnPerformDirectAction_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Ljava_util_function_Consumer_Handler", ApiSince=29)]
public virtual void OnPerformDirectAction (string actionId, Android.OS.Bundle arguments, Android.OS.CancellationSignal cancellationSignal, Java.Util.Functions.IConsumer resultListener);
[<Android.Runtime.Register("onPerformDirectAction", "(Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;Ljava/util/function/Consumer;)V", "GetOnPerformDirectAction_Ljava_lang_String_Landroid_os_Bundle_Landroid_os_CancellationSignal_Ljava_util_function_Consumer_Handler", ApiSince=29)>]
abstract member OnPerformDirectAction : string * Android.OS.Bundle * Android.OS.CancellationSignal * Java.Util.Functions.IConsumer -> unit
override this.OnPerformDirectAction : string * Android.OS.Bundle * Android.OS.CancellationSignal * Java.Util.Functions.IConsumer -> unit

Parameters

actionId
String

The ID for the action you previously reported via #onGetDirectActions(CancellationSignal, Consumer).

arguments
Bundle

Any additional arguments provided by the caller that are specific to the given action.

cancellationSignal
CancellationSignal

A signal to cancel the operation in progress.

resultListener
IConsumer

The callback to provide the result back to the caller. You can call this on any thread. The result bundle is action specific.

Attributes

Remarks

This is called to perform an action previously defined by the app. Apps also have access to #getVoiceInteractor() to follow up on the action.

Java documentation for android.app.Activity.onPerformDirectAction(java.lang.String, android.os.Bundle, android.os.CancellationSignal, java.util.function.Consumer<android.os.Bundle>).

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