Language

AppInteractionManager.CreateSession メソッド

定義

指定されたパラメーターのアプリ操作セッションを作成します。

[Android.Runtime.Register("createSession", "(Landroid/app/AppInteractionSession$CreateParams;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)]
public void CreateSession(Android.App.AppInteractionSession.CreateParams params, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("createSession", "(Landroid/app/AppInteractionSession$CreateParams;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)>]
member this.CreateSession : Android.App.AppInteractionSession.CreateParams * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

パラメーター

params
AppInteractionSession.CreateParams

セッションを作成するパラメーター。 この値は null にすることはできません。

executor
IExecutor

コールバックを実行する Executor。 この値は null にすることはできません。 コールバック イベントとリスナー イベントは、この Executor を介してディスパッチされるため、使用するスレッドを簡単に制御できます。 アプリケーションのメイン スレッドを介してイベントをディスパッチするには、Context.getMainExecutor() を使用できます。 それ以外の場合は、適切なスレッドにディスパッチする Executor を指定します。

callback
IOutcomeReceiver

セッションが作成されたとき、またはエラーが発生したときに呼び出されるコールバック。 この値は null にすることはできません。

属性

注釈

指定されたパラメーターのアプリ操作セッションを作成します。

AppInteractionSession.CreateParams createSessionParams =
    new AppInteractionSession.CreateParams.Builder()
        .setOnStartIntentSenderCallback(
            executor,
            intentSender -> {
                // The callback will be invoked if the session creation requires user consent
                try {
                    context.startIntentSender(intentSender, null, 0, 0, 0);
                } catch (IntentSender.SendIntentException e) {
                    // Handle exception
                }
            }
        )
        .setTargetPackages(Arrays.asList("com.example.target1"))
        .build();

appInteractionManager.createSession(createSessionParams, executor, callback);

android.app.AppInteractionManager.createSessionの Android リファレンス。

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

適用対象