Language

PendingIntent.GetForegroundService メソッド

定義

Context#startForegroundService Context.startForegroundService()の呼び出しなど、フォアグラウンド サービスを開始する PendingIntent を取得します。

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

パラメーター

context
Context

この PendingIntent がサービスを開始するコンテキスト。

requestCode
Int32

送信者のプライベート要求コード

intent
Intent

開始するサービスを説明する意図。

flags
PendingIntentFlags

実際の送信が発生したときに指定できる意図の指定されていない部分を制御するために、#FLAG_ONE_SHOTでサポートされているフラグの#FLAG_NO_CREATE、#FLAG_CANCEL_CURRENT、#FLAG_UPDATE_CURRENT、#FLAG_IMMUTABLE、Intent#fillIn Intent.fillIn()、またはいずれかのフラグを使用できます。

返品

指定されたパラメーターに一致する既存または新規のPendingIntent を返します。 #FLAG_NO_CREATEが指定されている場合にのみ、null を返す場合があります。

属性

注釈

Context.startForegroundService() の呼び出しなど、フォアグラウンド サービスを開始する PendingIntent を取得します。 サービスに渡される開始引数は、インテントの追加の引数から取得されます。 セキュリティ上の理由から、ここで指定する意図は、ほとんどの場合、Intent.setClass 経由で配信される明示的なコンポーネントを指定する明示的な意図である必要があります。

android.app.PendingIntent.getForegroundServiceの Android リファレンス。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象