AppFunctionMetadata.ScopeGlobal 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
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。 这对于绑定到单一实例组件的函数(例如前台服务)非常有用。
使用 AppFunctionManager.registerAppFunction 时,该函数将保持注册状态,直到显式注销或调用上下文被销毁。
若要执行全局范围的函数,AppFunctionManager.executeAppFunction 的调用方不得使用 ExecuteAppFunctionRequest.Builder.setActivityId(或将其设置为 null),否则将返回AppFunctionException.ERROR_FUNCTION_NOT_FOUND。
这始终是基于 AppFunctionService 的函数的范围。
重要说明:从活动上下文调用的 AppFunctionManager.registerAppFunction 提供的函数应首选SCOPE_ACTIVITY。 如果绝对确定只有该活动的一个实例,则仅对此类函数使用SCOPE_GLOBAL。
Android 参考。android.app.appfunctions.AppFunctionMetadata.SCOPE_GLOBAL
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。