PendingIntent.GetBroadcast(Context, Int32, Intent, PendingIntentFlags) Method

Definition

Retrieve a PendingIntent that will perform a broadcast, like calling Context.sendBroadcast().

[Android.Runtime.Register("getBroadcast", "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;", "")]
public static Android.App.PendingIntent? GetBroadcast(Android.Content.Context? context, int requestCode, Android.Content.Intent intent, Android.App.PendingIntentFlags flags);
[<Android.Runtime.Register("getBroadcast", "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;", "")>]
static member GetBroadcast : Android.Content.Context * int * Android.Content.Intent * Android.App.PendingIntentFlags -> Android.App.PendingIntent

Parameters

context
Context

Context: The Context in which this PendingIntent should perform the broadcast.

requestCode
Int32

int: Private request code for the sender

intent
Intent

Intent: The Intent to be broadcast. This value cannot be null.

flags
PendingIntentFlags

int: May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, FLAG_IMMUTABLE or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens. Value is either 0 or a combination of the following: FLAG_ONE_SHOT FLAG_NO_CREATE FLAG_CANCEL_CURRENT FLAG_UPDATE_CURRENT FLAG_IMMUTABLE FLAG_MUTABLE FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT Intent.FILL_IN_ACTION Intent.FILL_IN_DATA Intent.FILL_IN_CATEGORIES Intent.FILL_IN_COMPONENT Intent.FILL_IN_PACKAGE Intent.FILL_IN_SOURCE_BOUNDS Intent.FILL_IN_SELECTOR Intent.FILL_IN_CLIP_DATA

Returns

The PendingIntent for the requested operation, or null when FLAG_NO_CREATE is set and no matching PendingIntent exists.

Attributes

Remarks

Retrieve a PendingIntent that will perform a broadcast, like calling Context.sendBroadcast(). For security reasons, the Intent you supply here should almost always be an explicit intent, that is specify an explicit component to be delivered to through Intent.setClass

Android reference for android.app.PendingIntent.getBroadcast.

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