Sdílet prostřednictvím


Context.SendBroadcastAsUser Method

Definition

Overloads

SendBroadcastAsUser(Intent, UserHandle)

Version of #sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

SendBroadcastAsUser(Intent, UserHandle, String)

Version of #sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to.

SendBroadcastAsUser(Intent, UserHandle)

Version of #sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

[Android.Runtime.Register("sendBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;)V", "GetSendBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Handler")]
[Android.Runtime.RequiresPermission("android.permission.INTERACT_ACROSS_USERS")]
public abstract 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")>]
[<Android.Runtime.RequiresPermission("android.permission.INTERACT_ACROSS_USERS")>]
abstract member SendBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle -> unit

Parameters

intent
Intent

The intent to broadcast

user
UserHandle

UserHandle to send the intent to.

Attributes

Remarks

Version of #sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to. This is not available to applications that are not pre-installed on the system image.

Java documentation for android.content.Context.sendBroadcastAsUser(android.content.Intent, android.os.UserHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

SendBroadcastAsUser(Intent, UserHandle, String)

Version of #sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to.

[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")]
[Android.Runtime.RequiresPermission("android.permission.INTERACT_ACROSS_USERS")]
public abstract 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")>]
[<Android.Runtime.RequiresPermission("android.permission.INTERACT_ACROSS_USERS")>]
abstract member SendBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle * string -> unit

Parameters

intent
Intent

The Intent to broadcast; all receivers matching this Intent will receive the broadcast.

user
UserHandle

UserHandle to send the intent to.

receiverPermission
String

(optional) String naming a permission that a receiver must hold in order to receive your broadcast. If null, no permission is required.

Attributes

Remarks

Version of #sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to. This is not available to applications that are not pre-installed on the system image.

Java documentation for android.content.Context.sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

  • <xref:Android.Content.Context.SendBroadcast(Android.Content.Intent%2c+System.String)>

Applies to