Most visited

Recently visited

Added in API level 23

VoiceInteractor.PickOptionRequest

public static class VoiceInteractor.PickOptionRequest
extends VoiceInteractor.Request

java.lang.Object
   ↳ android.app.VoiceInteractor.Request
     ↳ android.app.VoiceInteractor.PickOptionRequest


用户通过可信系统VoiceInteractionService从多个潜在选项中选择一个选项。 通常,应用程序将以可视方式呈现为列表视图,以允许通过触摸来选择选项。 确认的结果将通过对onPickOptionResult(boolean, VoiceInteractor.PickOptionRequest.Option[], Bundle)onCancel()的异步调用返回 - 应该重写这些方法以定义特定于应用程序的行为。

Summary

Nested classes

class VoiceInteractor.PickOptionRequest.Option

表示用户可以使用他们的语音选择的单个选项。

Public constructors

VoiceInteractor.PickOptionRequest(VoiceInteractor.Prompt prompt, Option[] options, Bundle extras)

创建一个新的选择选项请求。

Public methods

void onPickOptionResult(boolean finished, Option[] selections, Bundle result)

当单个选项被确认或缩小到几个选项之一时调用。

Inherited methods

From class android.app.VoiceInteractor.Request
From class java.lang.Object

Public constructors

VoiceInteractor.PickOptionRequest

Added in API level 23
VoiceInteractor.PickOptionRequest (VoiceInteractor.Prompt prompt, 
                Option[] options, 
                Bundle extras)

创建一个新的选择选项请求。

Parameters
prompt VoiceInteractor.Prompt: Optional question to be asked of the user when the options are presented or null if nothing should be asked.
options Option: The set of VoiceInteractor.PickOptionRequest.Options the user is selecting from.
extras Bundle: Additional optional information or null.

Public methods

onPickOptionResult

Added in API level 23
void onPickOptionResult (boolean finished, 
                Option[] selections, 
                Bundle result)

当单个选项被确认或缩小到几个选项之一时调用。 重写此方法以定义用户选择选项或缩小选项集时的行为。

Parameters
finished boolean: True if the voice interaction has finished making a selection, in which case selections contains the final result. If false, this request is still active and you will continue to get calls on it.
selections Option: Either a single VoiceInteractor.PickOptionRequest.Option or one of several VoiceInteractor.PickOptionRequest.Options the user has narrowed the choices down to.
result Bundle: Additional optional information.

Hooray!