Added in API level 23

Request


abstract class Request
VoiceInteractor.AbortVoiceRequest

Reports that the current interaction can not be complete with voice, so the application will need to switch to a traditional input UI.

VoiceInteractor.CommandRequest

Execute a vendor-specific command using the trusted system VoiceInteractionService.

VoiceInteractor.CompleteVoiceRequest

Reports that the current interaction was successfully completed with voice, so the application can report the final status to the user.

VoiceInteractor.ConfirmationRequest

Confirms an operation with the user via the trusted system VoiceInteractionService.

VoiceInteractor.PickOptionRequest

Select a single option from multiple potential options with the user via the trusted system VoiceInteractionService.

Base class for voice interaction requests that can be submitted to the interactor. Do not instantiate this directly -- instead, use the appropriate subclass.

Summary

Public methods
open Unit

Cancel this active request.

open Activity!

Return the current Activity this request is associated with.

open Context!

Return the current Context this request is associated with.

open String!

Return the name this request was submitted through submitRequest(android.app.VoiceInteractor.Request,java.lang.String).

open Unit
onAttached(activity: Activity!)

The request is now attached to an activity, or being re-attached to a new activity after a configuration change.

open Unit

Report from voice interaction service: this operation has been canceled, typically as a completion of a previous call to cancel or when the user explicitly cancelled.

open Unit

The request is being detached from an activity.

open String

Public methods

cancel

Added in API level 23
open fun cancel(): Unit

Cancel this active request.

getActivity

Added in API level 23
open fun getActivity(): Activity!

Return the current Activity this request is associated with. Will change if the activity is restarted such as through a configuration change.

getContext

Added in API level 23
open fun getContext(): Context!

Return the current Context this request is associated with. May change if the activity hosting it goes through a configuration change.

getName

Added in API level 23
open fun getName(): String!

Return the name this request was submitted through submitRequest(android.app.VoiceInteractor.Request,java.lang.String).

onAttached

Added in API level 23
open fun onAttached(activity: Activity!): Unit

The request is now attached to an activity, or being re-attached to a new activity after a configuration change.

onCancel

Added in API level 23
open fun onCancel(): Unit

Report from voice interaction service: this operation has been canceled, typically as a completion of a previous call to cancel or when the user explicitly cancelled.

onDetached

Added in API level 23
open fun onDetached(): Unit

The request is being detached from an activity.

toString

Added in API level 23
open fun toString(): String
Return
String a string representation of the object.