語言

AppFunctionManager.ExecuteAppFunction 方法

定義

多載

ExecuteAppFunction(ExecuteAppFunctionRequest, IExecutor, CancellationSignal, IOutcomeReceiver)

執行應用程式功能。

[Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
public void ExecuteAppFunction(Android.App.AppFunctions.ExecuteAppFunctionRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal cancellationSignal, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
member this.ExecuteAppFunction : Android.App.AppFunctions.ExecuteAppFunctionRequest * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.OS.IOutcomeReceiver -> unit

參數

request
ExecuteAppFunctionRequest

執行應用程式函式的請求

executor
IExecutor

執行者執行回調

cancellationSignal
CancellationSignal

取消執行的信號。

callback
IOutcomeReceiver

回調以接收函式執行結果或錯誤。 <p>若呼叫應用程式不擁有該應用程式函式或不具備 android.permission.EXECUTE_APP_FUNCTIONS,執行結果將包含 AppFunctionException.ERROR_DENIED。 <p>若呼叫者只有 android.permission.EXECUTE_APP_FUNCTIONS,執行結果將包含 AppFunctionException.ERROR_DENIED<p>。若請求執行的函式被禁用,則執行結果將包含 AppFunctionException.ERROR_DISABLED<p>。若發出取消訊號,操作被取消且呼叫者不會回應。

屬性

備註

執行應用程式功能。

注意:應用程式可以執行他們定義的函式。 若要執行其他元件中定義的函式,應用程式需要擁有 權限。android.permission.EXECUTE_APP_FUNCTIONS

Java 文件 android.app.appfunctions.AppFunctionManager.executeAppFunction(android.app.appfunctions.ExecuteAppFunctionRequest, java.util.concurrent.Executor, android.os.CancellationSignal, android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse, android.app.appfunctions.AppFunctionException>)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

ExecuteAppFunction(AppInteractionSession, ExecuteAppFunctionRequest, IExecutor, CancellationSignal, IOutcomeReceiver)

透過 AppInteractionSession 執行應用程式函式。

[Android.Runtime.Register("executeAppFunction", "(Landroid/app/AppInteractionSession;Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)]
public void ExecuteAppFunction(Android.App.AppInteractionSession appInteractionSession, Android.App.AppFunctions.ExecuteAppFunctionRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal cancellationSignal, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("executeAppFunction", "(Landroid/app/AppInteractionSession;Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)>]
member this.ExecuteAppFunction : Android.App.AppInteractionSession * Android.App.AppFunctions.ExecuteAppFunctionRequest * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.OS.IOutcomeReceiver -> unit

參數

appInteractionSession
AppInteractionSession

應用程式互動會話來關聯到函式執行。 這個值不可能為零值。

request
ExecuteAppFunctionRequest

執行應用程式函式的請求。 這個值不可能為零值。

executor
IExecutor

執行者負責執行回調。 這個值不可能為零值。 回調與監聽事件透過此執行器派遣,提供簡便控制使用執行緒的方式。 要透過應用程式的主執行緒派發事件,可以使用 Context.getMainExecutor()。 否則,提供一個執行者,將執行者派遣到適當的執行緒。

cancellationSignal
CancellationSignal

取消執行的信號。 這個值不可能為零值。

callback
IOutcomeReceiver

回調以接收函式執行結果或錯誤。 這個值不可能為零值。

屬性

備註

透過 AppInteractionSession 執行應用程式函式。

應用程式可以執行他們定義的函式。 若要執行其他元件中定義的函式,呼叫者必須擁有Manifest.permission.EXECUTE_APP_FUNCTIONS或android.permission.EXECUTE_APP_FUNCTIONS_SYSTEM權限。

函式只有在其 AppFunctionState.isEnabled 為真時才能執行。

請參閱 AppFunctionException 以了解可能的失敗。

Android 參考資料。android.app.appfunctions.AppFunctionManager.executeAppFunction

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於