PendingIntent.GetService(Context, Int32, Intent, PendingIntentFlags) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieve a PendingIntent that will start a service, like calling
Context#startService Context.startService()
.
[Android.Runtime.Register("getService", "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;", "")]
public static Android.App.PendingIntent? GetService (Android.Content.Context? context, int requestCode, Android.Content.Intent intent, Android.App.PendingIntentFlags flags);
[<Android.Runtime.Register("getService", "(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;", "")>]
static member GetService : Android.Content.Context * int * Android.Content.Intent * Android.App.PendingIntentFlags -> Android.App.PendingIntent
Parameters
- context
- Context
The Context in which this PendingIntent should start the service.
- requestCode
- Int32
Private request code for the sender
- intent
- Intent
An Intent describing the service to be started.
- flags
- PendingIntentFlags
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 Intent.fillIn()
to control which unspecified parts
of the intent that can be supplied when the actual send happens.
Returns
Returns an existing or new PendingIntent matching the given
parameters. May return null only if #FLAG_NO_CREATE
has been
supplied.
- Attributes
Remarks
Retrieve a PendingIntent that will start a service, like calling Context#startService Context.startService()
. The start arguments given to the service will come from the extras of the Intent.
<p class="note">For security reasons, the android.content.Intent
you supply here should almost always be an <em>explicit intent</em>, that is specify an explicit component to be delivered to through Intent#setClass(android.content.Context, Class) Intent.setClass
</p>
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.