语言

BroadcastOptions.SetShareIdentityEnabled(Boolean) 方法

定义

设置广播应用的标识是否应与接收此广播的所有接收方共享。

[Android.Runtime.Register("setShareIdentityEnabled", "(Z)Landroid/app/BroadcastOptions;", "GetSetShareIdentityEnabled_ZHandler", ApiSince=34)]
public virtual Android.App.BroadcastOptions SetShareIdentityEnabled(bool shareIdentityEnabled);
[<Android.Runtime.Register("setShareIdentityEnabled", "(Z)Landroid/app/BroadcastOptions;", "GetSetShareIdentityEnabled_ZHandler", ApiSince=34)>]
abstract member SetShareIdentityEnabled : bool -> Android.App.BroadcastOptions
override this.SetShareIdentityEnabled : bool -> Android.App.BroadcastOptions

参数

shareIdentityEnabled
Boolean

是否应与接收方共享广播应用的标识

返回

this BroadcastOptions instance

特性

注解

设置广播应用的标识是否应与接收此广播的所有接收方共享。 当广播到需要知道广播者的标识的接收方时,请使用此选项;如果设置为 true,接收方将有权访问广播应用的包名称和 uid。 如果未设置,则默认为 false。

Android 参考。android.app.BroadcastOptions.setShareIdentityEnabled

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于