MockContext.SendBroadcastAsUser 方法

定义

重载

SendBroadcastAsUser(Intent, UserHandle, String)

SendBroadcast(Intent, String)该版本允许你指定将发送到该广播的用户。

SendBroadcastAsUser(Intent, UserHandle)

SendBroadcast(Intent)该版本允许你指定将发送到该广播的用户。

SendBroadcastAsUser(Intent, UserHandle, String)

SendBroadcast(Intent, String)该版本允许你指定将发送到该广播的用户。

[Android.Runtime.Register("sendBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;Ljava/lang/String;)V", "GetSendBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Ljava_lang_String_Handler")]
public override void SendBroadcastAsUser (Android.Content.Intent? intent, Android.OS.UserHandle? user, string? receiverPermission);
[<Android.Runtime.Register("sendBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;Ljava/lang/String;)V", "GetSendBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Ljava_lang_String_Handler")>]
override this.SendBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle * string -> unit

参数

intent
Intent

广播意向;匹配此意向的所有接收方都将接收广播。

user
UserHandle

要向其发送意向的 UserHandle。

receiverPermission
String

(可选)字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。

属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

SendBroadcastAsUser(Intent, UserHandle)

SendBroadcast(Intent)该版本允许你指定将发送到该广播的用户。

[Android.Runtime.Register("sendBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;)V", "GetSendBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Handler")]
public override void SendBroadcastAsUser (Android.Content.Intent? intent, Android.OS.UserHandle? user);
[<Android.Runtime.Register("sendBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;)V", "GetSendBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Handler")>]
override this.SendBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle -> unit

参数

intent
Intent

广播的意图

user
UserHandle

要向其发送意向的 UserHandle。

属性

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于