Added in API level 23

ConfirmationRequest


class ConfirmationRequest : VoiceInteractionSession.Request

A request for confirmation from the user of an operation, as per VoiceInteractor.ConfirmationRequest.

Summary

Public methods
CharSequence?

Return the prompt informing the user of what will happen, as per VoiceInteractor.ConfirmationRequest.

VoiceInteractor.Prompt?

Return the prompt informing the user of what will happen, as per VoiceInteractor.ConfirmationRequest.

Unit
sendConfirmationResult(confirmed: Boolean, result: Bundle!)

Report that the voice interactor has confirmed the operation with the user, resulting in a call to VoiceInteractor.ConfirmationRequest.onConfirmationResult.

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

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 will happen, as per VoiceInteractor.ConfirmationRequest.

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 will happen, as per VoiceInteractor.ConfirmationRequest.

Return
VoiceInteractor.Prompt? This value may be null.

sendConfirmationResult

Added in API level 23
fun sendConfirmationResult(
    confirmed: Boolean,
    result: Bundle!
): Unit

Report that the voice interactor has confirmed the operation with the user, resulting in a call to VoiceInteractor.ConfirmationRequest.onConfirmationResult. This finishes the request (it is no longer active).