Added in API level 23

PickOptionRequest


class PickOptionRequest : VoiceInteractionSession.Request

A request for the user to pick from a set of option, as per VoiceInteractor.PickOptionRequest.

Summary

Public methods
Array<VoiceInteractor.PickOptionRequest.Option!>!

Return the set of options the user is picking from, as per VoiceInteractor.PickOptionRequest.

CharSequence?

Return the prompt informing the user of what they are picking, as per VoiceInteractor.PickOptionRequest.

VoiceInteractor.Prompt?

Return the prompt informing the user of what they are picking, as per VoiceInteractor.PickOptionRequest.

Unit

Report an intermediate option selection from the request, without completing it (the request is still active and the app is waiting for the final option selection), resulting in a call to VoiceInteractor.PickOptionRequest.onPickOptionResult with false for finished.

Unit

Report the final option selection for the request, completing the request and resulting in a call to VoiceInteractor.PickOptionRequest.onPickOptionResult with false for finished.

Inherited functions
Unit cancel()

Ask the app to cancel this current request. This also finishes the request (it is no longer active).

String! getCallingPackage()

Return the package name of the application that initiated the request.

Int getCallingUid()

Return the uid of the application that initiated the request.

Bundle! getExtras()

Return any additional extra information that was supplied as part of the request.

Boolean isActive()

Check whether this request is currently active. A request becomes inactive after calling cancel or a final result method that completes the request. After this point, further interactions with the request will result in java.lang.IllegalStateException errors; you should not catch these errors, but can use this method if you need to determine the state of the request. Returns true if the request is still active.

String toString()

Public methods

getOptions

Added in API level 23
fun getOptions(): Array<VoiceInteractor.PickOptionRequest.Option!>!

Return the set of options the user is picking from, as per VoiceInteractor.PickOptionRequest.

getPrompt

Added in API level 23
Deprecated in API level 23
fun getPrompt(): CharSequence?

Deprecated: Prefer getVoicePrompt() which allows multiple voice prompts.

Return the prompt informing the user of what they are picking, as per VoiceInteractor.PickOptionRequest.

Return
CharSequence? This value may be null.

getVoicePrompt

Added in API level 23
fun getVoicePrompt(): VoiceInteractor.Prompt?

Return the prompt informing the user of what they are picking, as per VoiceInteractor.PickOptionRequest.

Return
VoiceInteractor.Prompt? This value may be null.

sendIntermediatePickOptionResult

Added in API level 23
fun sendIntermediatePickOptionResult(
    selections: Array<VoiceInteractor.PickOptionRequest.Option!>!,
    result: Bundle!
): Unit

Report an intermediate option selection from the request, without completing it (the request is still active and the app is waiting for the final option selection), resulting in a call to VoiceInteractor.PickOptionRequest.onPickOptionResult with false for finished.

sendPickOptionResult

Added in API level 23
fun sendPickOptionResult(
    selections: Array<VoiceInteractor.PickOptionRequest.Option!>!,
    result: Bundle!
): Unit

Report the final option selection for the request, completing the request and resulting in a call to VoiceInteractor.PickOptionRequest.onPickOptionResult with false for finished. This finishes the request (it is no longer active).