Share via


Context.RemoveStickyBroadcastAsUser(Intent, UserHandle) Method

Definition

Caution

deprecated

Version of #removeStickyBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

[Android.Runtime.Register("removeStickyBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;)V", "GetRemoveStickyBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Handler")]
[System.Obsolete("deprecated")]
public abstract void RemoveStickyBroadcastAsUser (Android.Content.Intent? intent, Android.OS.UserHandle? user);
[<Android.Runtime.Register("removeStickyBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;)V", "GetRemoveStickyBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member RemoveStickyBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle -> unit

Parameters

intent
Intent

The Intent that was previously broadcast.

user
UserHandle

UserHandle to remove the sticky broadcast from.

Attributes

Remarks

Version of #removeStickyBroadcast(Intent) that allows you to specify the user the broadcast will be sent to. This is not available to applications that are not pre-installed on the system image.

You must hold the android.Manifest.permission#BROADCAST_STICKY permission in order to use this API. If you do not hold that permission, SecurityException will be thrown.

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.removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle).

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

See also

  • <xref:Android.Content.Context.SendStickyBroadcastAsUser(Android.Content.Intent%2c+Android.OS.UserHandle)>