共用方式為


Context.SendBroadcast Method

Definition

Overloads

SendBroadcast(Intent)

Broadcast the given intent to all interested BroadcastReceivers.

SendBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

SendBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

SendBroadcast(Intent)

Broadcast the given intent to all interested BroadcastReceivers.

[Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;)V", "GetSendBroadcast_Landroid_content_Intent_Handler")]
public abstract void SendBroadcast (Android.Content.Intent? intent);
[<Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;)V", "GetSendBroadcast_Landroid_content_Intent_Handler")>]
abstract member SendBroadcast : Android.Content.Intent -> unit

Parameters

intent
Intent

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

Attributes

Remarks

Broadcast the given intent to all interested BroadcastReceivers. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run. No results are propagated from receivers and receivers can not abort the broadcast. If you want to allow receivers to propagate results or abort the broadcast, you must send an ordered broadcast using #sendOrderedBroadcast(Intent, String).

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendBroadcast(android.content.Intent).

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

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

Applies to

SendBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

[Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;Ljava/lang/String;)V", "GetSendBroadcast_Landroid_content_Intent_Ljava_lang_String_Handler")]
public abstract void SendBroadcast (Android.Content.Intent? intent, string? receiverPermission);
[<Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;Ljava/lang/String;)V", "GetSendBroadcast_Landroid_content_Intent_Ljava_lang_String_Handler")>]
abstract member SendBroadcast : Android.Content.Intent * string -> unit

Parameters

intent
Intent

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

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

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run. No results are propagated from receivers and receivers can not abort the broadcast. If you want to allow receivers to propagate results or abort the broadcast, you must send an ordered broadcast using #sendOrderedBroadcast(Intent, String).

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendBroadcast(android.content.Intent, 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

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

Applies to

SendBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

[Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;)V", "GetSendBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)]
public virtual void SendBroadcast (Android.Content.Intent intent, string? receiverPermission, Android.OS.Bundle? options);
[<Android.Runtime.Register("sendBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;)V", "GetSendBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)>]
abstract member SendBroadcast : Android.Content.Intent * string * Android.OS.Bundle -> unit
override this.SendBroadcast : Android.Content.Intent * string * Android.OS.Bundle -> unit

Parameters

intent
Intent

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

receiverPermission
String

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

options
Bundle

(optional) Additional sending options, generated from a android.app.BroadcastOptions.

Attributes

Remarks

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run. No results are propagated from receivers and receivers can not abort the broadcast. If you want to allow receivers to propagate results or abort the broadcast, you must send an ordered broadcast using #sendOrderedBroadcast(Intent, String).

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle).

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.

Applies to