Condividi tramite


Context.SendStickyBroadcast Method

Definition

Overloads

SendStickyBroadcast(Intent)
Obsolete.

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

SendStickyBroadcast(Intent, Bundle)

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

SendStickyBroadcast(Intent)

Caution

deprecated

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #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

Parameters

intent
Intent

The Intent to broadcast; all receivers matching this Intent will receive the broadcast, and the Intent will be held to be re-broadcast to future receivers.

Attributes

Remarks

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as #sendBroadcast(Intent).

This member is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that <em>something</em> has changed, with another mechanism for apps to retrieve the current value whenever desired.

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

  • 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)>

Applies to

SendStickyBroadcast(Intent, Bundle)

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #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

Parameters

intent
Intent

The Intent to broadcast; all receivers matching this Intent will receive the broadcast, and the Intent will be held to be re-broadcast to future receivers.

options
Bundle

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

Attributes

Remarks

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as #sendBroadcast(Intent).

This member is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that <em>something</em> has changed, with another mechanism for apps to retrieve the current value whenever desired.

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