Context.SendStickyBroadcast 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| SendStickyBroadcast(Intent) |
已过时.
|
| SendStickyBroadcast(Intent, Bundle) |
|
SendStickyBroadcast(Intent)
注意
deprecated
#sendBroadcast(Intent)执行“粘滞”,这意味着在广播完成后发送的意向将保留在周围,以便其他人可以通过返回值#registerReceiver(BroadcastReceiver, IntentFilter)快速检索该数据。
[Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Handler")]
[Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")]
[System.Obsolete("deprecated")]
public abstract void SendStickyBroadcast(Android.Content.Intent? intent);
[<Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")>]
[<System.Obsolete("deprecated")>]
abstract member SendStickyBroadcast : Android.Content.Intent -> unit
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方将接收广播,并将保留意向以重新广播给未来的接收方。
- 特性
注解
#sendBroadcast(Intent)执行“粘滞”,这意味着在广播完成后发送的意向将保留在周围,以便其他人可以通过返回值#registerReceiver(BroadcastReceiver, IntentFilter)快速检索该数据。 在所有其他方面,这的行为与 #sendBroadcast(Intent)..
此成员已弃用。 不应使用粘滞广播。 他们不提供任何安全性(任何人都可以访问它们)、没有保护(任何人都可以修改它们)和其他许多问题。 建议的模式是使用非粘滞广播来报告某些 内容 已更改,另一种机制供应用在需要时检索当前值。
Java文档android.content.Context.sendStickyBroadcast(android.content.Intent)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
另请参阅
- SendBroadcast(Intent)
- <xref:Android.Content.Context.SendStickyOrderedBroadcast(Android.Content.Intent%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver%2c+Android.Content.BroadcastReceiver)>
适用于
SendStickyBroadcast(Intent, Bundle)
#sendBroadcast(Intent)执行“粘滞”,这意味着在广播完成后发送的意向将保留在周围,以便其他人可以通过返回值#registerReceiver(BroadcastReceiver, IntentFilter)快速检索该数据。
[Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Landroid_os_Bundle_Handler", ApiSince=31)]
[Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")]
public virtual void SendStickyBroadcast(Android.Content.Intent intent, Android.OS.Bundle? options);
[<Android.Runtime.Register("sendStickyBroadcast", "(Landroid/content/Intent;Landroid/os/Bundle;)V", "GetSendStickyBroadcast_Landroid_content_Intent_Landroid_os_Bundle_Handler", ApiSince=31)>]
[<Android.Runtime.RequiresPermission("android.permission.BROADCAST_STICKY")>]
abstract member SendStickyBroadcast : Android.Content.Intent * Android.OS.Bundle -> unit
override this.SendStickyBroadcast : Android.Content.Intent * Android.OS.Bundle -> unit
参数
- intent
- Intent
广播意向;匹配此意向的所有接收方将接收广播,并将保留意向以重新广播给未来的接收方。
- options
- Bundle
(可选)其他发送选项,从 . android.app.BroadcastOptions.
- 特性
注解
#sendBroadcast(Intent)执行“粘滞”,这意味着在广播完成后发送的意向将保留在周围,以便其他人可以通过返回值#registerReceiver(BroadcastReceiver, IntentFilter)快速检索该数据。 在所有其他方面,这的行为与 #sendBroadcast(Intent)..
此成员已弃用。 不应使用粘滞广播。 他们不提供任何安全性(任何人都可以访问它们)、没有保护(任何人都可以修改它们)和其他许多问题。 建议的模式是使用非粘滞广播来报告某些 内容 已更改,另一种机制供应用在需要时检索当前值。
Java文档android.content.Context.sendStickyBroadcast(android.content.Intent, android.os.Bundle)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。