言語

AppFunctionMetadata.ScopeGlobal フィールド

定義

注意事項

This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionMetadataScope enum directly instead of this field.

アプリ関数がグローバル スコープであることを示す定数。

[Android.Runtime.Register("SCOPE_GLOBAL", ApiSince=37)]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionMetadataScope enum directly instead of this field.", true)]
public const Android.App.AppFunctions.AppFunctionMetadataScope ScopeGlobal = 0;
[<Android.Runtime.Register("SCOPE_GLOBAL", ApiSince=37)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionMetadataScope enum directly instead of this field.", true)>]
val mutable ScopeGlobal : Android.App.AppFunctions.AppFunctionMetadataScope

フィールド値

Value = 0

実装

属性

注釈

アプリ関数がグローバル スコープであることを示す定数。

このスコープで使用できる AppFunctionName と同じアプリ関数の実装は、最大で 1 つです。 これは、フォアグラウンド サービスなどのシングルトン コンポーネントに関連付けられている関数に役立ちます。

AppFunctionManager.registerAppFunction を使用する場合、関数は明示的に登録解除されるか、呼び出し元のコンテキストが破棄されるまで登録されたままになります。

グローバル スコープ関数を実行するには、AppFunctionManager.executeAppFunction の呼び出し元が ExecuteAppFunctionRequest.Builder.setActivityId (または null に設定) を使用しないでください。それ以外の場合は、AppFunctionException.ERROR_FUNCTION_NOT_FOUNDが返されます。

これは常に AppFunctionService ベースの関数のスコープです。

重要: アクティビティ コンテキストから呼び出される AppFunctionManager.registerAppFunction で提供される関数は、SCOPE_ACTIVITYを優先する必要があります。 そのアクティビティのインスタンスが 1 つしか存在できないことを絶対に確信している場合は、このような関数に対してSCOPE_GLOBALのみを使用してください。

android.app.appfunctions.AppFunctionMetadata.SCOPE_GLOBALの Android リファレンス。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象