Context.SendOrderedBroadcast Method

Definition

Overloads

SendOrderedBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

SendOrderedBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to.

SendOrderedBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

[Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Handler")]
public abstract void SendOrderedBroadcast (Android.Content.Intent? intent, string? receiverPermission);
[<Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Handler")>]
abstract member SendOrderedBroadcast : 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 permissions 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, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run.

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendOrderedBroadcast(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%2c+System.String%2c+System.String%2c+System.String%2c+System.String%2c+System.String)>

Applies to

SendOrderedBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

[Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)]
public virtual void SendOrderedBroadcast (Android.Content.Intent intent, string? receiverPermission, Android.OS.Bundle? options);
[<Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)>]
abstract member SendOrderedBroadcast : Android.Content.Intent * string * Android.OS.Bundle -> unit
override this.SendOrderedBroadcast : 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 permissions 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, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. This call is asynchronous; it returns immediately, and you will continue executing while the receivers are run.

See BroadcastReceiver for more information on Intent broadcasts.

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

SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

[Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler")]
public abstract void SendOrderedBroadcast (Android.Content.Intent intent, string? receiverPermission, Android.Content.BroadcastReceiver? resultReceiver, Android.OS.Handler? scheduler, Android.App.Result initialCode, string? initialData, Android.OS.Bundle? initialExtras);
[<Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler")>]
abstract member SendOrderedBroadcast : Android.Content.Intent * string * Android.Content.BroadcastReceiver * Android.OS.Handler * Android.App.Result * string * Android.OS.Bundle -> unit

Parameters

intent
Intent

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

receiverPermission
String

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

resultReceiver
BroadcastReceiver

Your own BroadcastReceiver to treat as the final receiver of the broadcast.

scheduler
Handler

A custom Handler with which to schedule the resultReceiver callback; if null it will be scheduled in the Context's main thread.

initialCode
Result

An initial value for the result code. Often Activity.RESULT_OK.

initialData
String

An initial value for the result data. Often null.

initialExtras
Bundle

An initial value for the result extras. Often null.

Attributes

Remarks

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast. This is accomplished by supplying your own BroadcastReceiver when calling, which will be treated as a final receiver at the end of the broadcast -- its BroadcastReceiver#onReceive method will be called with the result values collected from the other receivers. The broadcast will be serialized in the same way as calling #sendOrderedBroadcast(Intent, String).

Like #sendBroadcast(Intent), this method is asynchronous; it will return before resultReceiver.onReceive() is called.

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, 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.

See also

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

Applies to

SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

[Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)]
public virtual void SendOrderedBroadcast (Android.Content.Intent intent, string? receiverPermission, Android.OS.Bundle? options, Android.Content.BroadcastReceiver? resultReceiver, Android.OS.Handler? scheduler, Android.App.Result initialCode, string? initialData, Android.OS.Bundle? initialExtras);
[<Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Landroid/os/Bundle;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Landroid_os_Bundle_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=34)>]
abstract member SendOrderedBroadcast : Android.Content.Intent * string * Android.OS.Bundle * Android.Content.BroadcastReceiver * Android.OS.Handler * Android.App.Result * string * Android.OS.Bundle -> unit
override this.SendOrderedBroadcast : Android.Content.Intent * string * Android.OS.Bundle * Android.Content.BroadcastReceiver * Android.OS.Handler * Android.App.Result * string * Android.OS.Bundle -> unit

Parameters

intent
Intent

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

receiverPermission
String

String naming a permissions 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.

resultReceiver
BroadcastReceiver

Your own BroadcastReceiver to treat as the final receiver of the broadcast.

scheduler
Handler

A custom Handler with which to schedule the resultReceiver callback; if null it will be scheduled in the Context's main thread.

initialCode
Result

An initial value for the result code. Often Activity.RESULT_OK.

initialData
String

An initial value for the result data. Often null.

initialExtras
Bundle

An initial value for the result extras. Often null.

Attributes

Remarks

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast. This is accomplished by supplying your own BroadcastReceiver when calling, which will be treated as a final receiver at the end of the broadcast -- its BroadcastReceiver#onReceive method will be called with the result values collected from the other receivers. The broadcast will be serialized in the same way as calling #sendOrderedBroadcast(Intent, String).

Like #sendBroadcast(Intent), this method is asynchronous; it will return before resultReceiver.onReceive() is called.

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, 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

SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to.

[Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Ljava_lang_String_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=30)]
public virtual void SendOrderedBroadcast (Android.Content.Intent intent, string? receiverPermission, string? receiverAppOp, Android.Content.BroadcastReceiver? resultReceiver, Android.OS.Handler? scheduler, Android.App.Result initialCode, string? initialData, Android.OS.Bundle? initialExtras);
[<Android.Runtime.Register("sendOrderedBroadcast", "(Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendOrderedBroadcast_Landroid_content_Intent_Ljava_lang_String_Ljava_lang_String_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler", ApiSince=30)>]
abstract member SendOrderedBroadcast : Android.Content.Intent * string * string * Android.Content.BroadcastReceiver * Android.OS.Handler * Android.App.Result * string * Android.OS.Bundle -> unit
override this.SendOrderedBroadcast : Android.Content.Intent * string * string * Android.Content.BroadcastReceiver * Android.OS.Handler * Android.App.Result * string * Android.OS.Bundle -> unit

Parameters

intent
Intent

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

receiverPermission
String

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

receiverAppOp
String

The app op associated with the broadcast. If null, no appOp is required. If both receiverAppOp and receiverPermission are non-null, a receiver must have both of them to receive the broadcast

resultReceiver
BroadcastReceiver

Your own BroadcastReceiver to treat as the final receiver of the broadcast.

scheduler
Handler

A custom Handler with which to schedule the resultReceiver callback; if null it will be scheduled in the Context's main thread.

initialCode
Result

An initial value for the result code. Often Activity.RESULT_OK.

initialData
String

An initial value for the result data. Often null.

initialExtras
Bundle

An initial value for the result extras. Often null.

Attributes

Remarks

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to.

See BroadcastReceiver for more information on Intent broadcasts.

Java documentation for android.content.Context.sendOrderedBroadcast(android.content.Intent, java.lang.String, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, 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