言語

AppFunctionMetadata.ScopeActivity フィールド

定義

注意事項

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

アプリ関数がアクティビティ スコープであることを示す定数。

[Android.Runtime.Register("SCOPE_ACTIVITY", 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 ScopeActivity = 1;
[<Android.Runtime.Register("SCOPE_ACTIVITY", 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 ScopeActivity : Android.App.AppFunctions.AppFunctionMetadataScope

フィールド値

Value = 1

実装

属性

注釈

アプリ関数がアクティビティ スコープであることを示す定数。

同じ AppFunctionName を持つ複数のアプリ関数の実装が同時に存在でき、それぞれが異なるアクティビティ インスタンスから登録され、AppFunctionActivityId によって識別されます。

このスコープを持つ関数は、AppFunctionManager.registerAppFunction を使用して登録する必要があり、アクティビティ コンテキストから呼び出す必要があります。 他のコンテキストから呼び出すと、IllegalStateException が発生します。

アクティビティ スコープ関数を実行するには、AppFunctionManager.executeAppFunction の呼び出し元が ExecuteAppFunctionRequest.Builder.setActivityId を使用する必要があります。それ以外の場合は、AppFunctionException.ERROR_FUNCTION_NOT_FOUNDが返されます。

アクティビティ スコープ関数が現在登録されている特定のアクティビティを検出するには、AppFunctionManager.getAppFunctionStates と AppFunctionManager.getAppFunctionActivityStates を参照してください。

関数は、明示的に登録解除されるか、アクティビティが破棄されるまで登録されたままです。

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

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

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

適用対象