Aracılığıyla paylaş


Context.SendStickyOrderedBroadcastAsUser Method

Definition

Caution

deprecated

Version of #sendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the user the broadcast will be sent to.

[Android.Runtime.Register("sendStickyOrderedBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendStickyOrderedBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler")]
[System.Obsolete("deprecated")]
public abstract void SendStickyOrderedBroadcastAsUser (Android.Content.Intent? intent, Android.OS.UserHandle? user, Android.Content.BroadcastReceiver? resultReceiver, Android.OS.Handler? scheduler, Android.App.Result initialCode, string? initialData, Android.OS.Bundle? initialExtras);
[<Android.Runtime.Register("sendStickyOrderedBroadcastAsUser", "(Landroid/content/Intent;Landroid/os/UserHandle;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V", "GetSendStickyOrderedBroadcastAsUser_Landroid_content_Intent_Landroid_os_UserHandle_Landroid_content_BroadcastReceiver_Landroid_os_Handler_ILjava_lang_String_Landroid_os_Bundle_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member SendStickyOrderedBroadcastAsUser : Android.Content.Intent * Android.OS.UserHandle * 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.

user
UserHandle

UserHandle to send the intent to.

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 #sendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, int, String, Bundle) 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.

See BroadcastReceiver for more information on Intent broadcasts.

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

See also

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