Context.SendOrderedBroadcast 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| SendOrderedBroadcast(Intent, String) |
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。 |
| SendOrderedBroadcast(Intent, String, Bundle) |
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。 |
| SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle) |
|
| SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle) |
|
| SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle) |
|
SendOrderedBroadcast(Intent, String)
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。
[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
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方都将接收广播。
- receiverPermission
- String
(可选)字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。
- 属性
注解
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。 此调用是异步的;它会立即返回,并在接收方运行时继续执行。
有关意向广播的详细信息,请参阅 BroadcastReceiver 。
Java文档android.content.Context.sendOrderedBroadcast(android.content.Intent, java.lang.String)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- 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)>
适用于
SendOrderedBroadcast(Intent, String, Bundle)
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。
[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
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方都将接收广播。
- receiverPermission
- String
(可选)字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。
- options
- Bundle
(可选)其他发送选项,从 . android.app.BroadcastOptions.
- 属性
注解
向所有感兴趣的 BroadcastReceivers 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。 此调用是异步的;它会立即返回,并在接收方运行时继续执行。
有关意向广播的详细信息,请参阅 BroadcastReceiver 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle)
#sendBroadcast(Intent)该版本允许从广播中接收数据。
[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
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方都将接收广播。
- receiverPermission
- String
字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。
- resultReceiver
- BroadcastReceiver
你自己的 BroadcastReceiver 将视为广播的最终接收方。
- scheduler
- Handler
一个自定义处理程序,用于计划 resultReceiver 回调;如果为 null,则会在上下文的主线程中计划它。
- initialCode
- Result
结果代码的初始值。 通常Activity.RESULT_OK。
- initialData
- String
结果数据的初始值。 通常为 null。
- initialExtras
- Bundle
结果的额外初始值。 通常为 null。
- 属性
注解
#sendBroadcast(Intent)该版本允许从广播中接收数据。 这是通过在调用时提供自己的 BroadcastReceiver 来实现的,它将在广播结束时将其视为最终接收方 -- 其 BroadcastReceiver#onReceive 方法将使用从其他接收方收集的结果值进行调用。 广播将以与调用 #sendOrderedBroadcast(Intent, String)相同的方式进行序列化。
同样 #sendBroadcast(Intent),此方法是异步的;它将在调用 resultReceiver.onReceive()之前返回。
有关意向广播的详细信息,请参阅 BroadcastReceiver 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- 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)>
适用于
SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)
#sendBroadcast(Intent)该版本允许从广播中接收数据。
[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
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方都将接收广播。
- receiverPermission
- String
字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。
- options
- Bundle
(可选)其他发送选项,从 . android.app.BroadcastOptions.
- resultReceiver
- BroadcastReceiver
你自己的 BroadcastReceiver 将视为广播的最终接收方。
- scheduler
- Handler
一个自定义处理程序,用于计划 resultReceiver 回调;如果为 null,则会在上下文的主线程中计划它。
- initialCode
- Result
结果代码的初始值。 通常Activity.RESULT_OK。
- initialData
- String
结果数据的初始值。 通常为 null。
- initialExtras
- Bundle
结果的额外初始值。 通常为 null。
- 属性
注解
#sendBroadcast(Intent)该版本允许从广播中接收数据。 这是通过在调用时提供自己的 BroadcastReceiver 来实现的,它将在广播结束时将其视为最终接收方 -- 其 BroadcastReceiver#onReceive 方法将使用从其他接收方收集的结果值进行调用。 广播将以与调用 #sendOrderedBroadcast(Intent, String)相同的方式进行序列化。
同样 #sendBroadcast(Intent),此方法是异步的;它将在调用 resultReceiver.onReceive()之前返回。
有关意向广播的详细信息,请参阅 BroadcastReceiver 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)
#sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String,
Bundle)该版本允许你指定应用操作,以强制限制将广播发送到哪些接收方。
[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
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方都将接收广播。
- receiverPermission
- String
字符串命名接收方必须保留的权限才能接收广播。 如果为 null,则不需要任何权限。
- receiverAppOp
- String
与广播关联的应用操作。 如果为 null,则不需要 appOp。 如果 receiverAppOp 和 receiverPermission 均为非 null,则接收方必须具有这两个接收器才能接收广播
- resultReceiver
- BroadcastReceiver
你自己的 BroadcastReceiver 将视为广播的最终接收方。
- scheduler
- Handler
一个自定义处理程序,用于计划 resultReceiver 回调;如果为 null,则会在上下文的主线程中计划它。
- initialCode
- Result
结果代码的初始值。 通常Activity.RESULT_OK。
- initialData
- String
结果数据的初始值。 通常为 null。
- initialExtras
- Bundle
结果的额外初始值。 通常为 null。
- 属性
注解
#sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle)该版本允许你指定应用操作,以强制限制将广播发送到哪些接收方。
有关意向广播的详细信息,请参阅 BroadcastReceiver 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。