语言

AppInteractionSession.UpdateParams.Builder.SetOnStartIntentSenderCallback 方法

定义

当用户需要批准会话更新时调用。

[Android.Runtime.Register("setOnStartIntentSenderCallback", "(Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Landroid/app/AppInteractionSession$UpdateParams$Builder;", "", ApiSince=37)]
public Android.App.AppInteractionSession.UpdateParams.Builder SetOnStartIntentSenderCallback(Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IConsumer callback);
[<Android.Runtime.Register("setOnStartIntentSenderCallback", "(Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Landroid/app/AppInteractionSession$UpdateParams$Builder;", "", ApiSince=37)>]
member this.SetOnStartIntentSenderCallback : Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> Android.App.AppInteractionSession.UpdateParams.Builder

参数

executor
IExecutor

要运行回调的执行程序。 此值不能为 null。 回调和侦听器事件通过此执行程序调度,提供一种控制使用哪个线程的简单方法。 若要通过应用程序的主线程调度事件,可以使用 Context.getMainExecutor()。 否则,请提供调度到相应线程的执行程序。

callback
IConsumer

需要用户批准会话请求时要调用的回调。 此值不能为 null。

返回

特性

注解

当用户需要批准会话更新时调用。

当 AppInteractionSession.update(UpdateParams、Executor、ResultReceiver)需要用户确认时,将调用此回调。

应用程序应通过调用 Context.startIntentSender(IntentSender、Intent、int、int、int、int)来允许更新会话的 UI。

Android 参考。android.app.AppInteractionSession.UpdateParams.Builder.setOnStartIntentSenderCallback

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于