Język

AppFunctionManager.RegisterAppFunctions Method

Definition

Registers several AppFunction implementations at once, sharing a single lifecycle.

[Android.Runtime.Register("registerAppFunctions", "(Ljava/util/List;)Landroid/app/appfunctions/AppFunctionRegistration;", "", ApiSince=37)]
public Android.App.AppFunctions.IAppFunctionRegistration RegisterAppFunctions(System.Collections.Generic.IList<Android.App.AppFunctions.RegisterAppFunctionRequest> requests);
[<Android.Runtime.Register("registerAppFunctions", "(Ljava/util/List;)Landroid/app/appfunctions/AppFunctionRegistration;", "", ApiSince=37)>]
member this.RegisterAppFunctions : System.Collections.Generic.IList<Android.App.AppFunctions.RegisterAppFunctionRequest> -> Android.App.AppFunctions.IAppFunctionRegistration

Parameters

requests
IList<RegisterAppFunctionRequest>

A list of RegisterAppFunctionRequest objects, each specifying a function to be registered. This value cannot be null.

Returns

A single AppFunctionRegistration object that can be used to unregister all the functions in the batch with one call. This value cannot be null.

Attributes

Remarks

Registers several AppFunction implementations at once, sharing a single lifecycle.

This is a more efficient alternative to calling registerAppFunction(String, Executor, AppFunction) multiple times. Behavior and Lifecycle

Each function registered through this method follows the same execution and lifecycle rules as those registered with registerAppFunction(String, Executor, AppFunction). Batch Operation and Atomicity

The registration is atomic: either all functions in the provided list are registered successfully, or none are. If any function in the list fails validation (e.g., its is already registered or not declared in the manifest), this method will throw an exception, and no functions from the batch will be registered. Each function in the request follows the scoping rules declared in the app's XML resources.

A single AppFunctionRegistration object is returned, which can be used to unregister the entire batch of functions with one call.

Android reference for android.app.appfunctions.AppFunctionManager.registerAppFunctions.

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