Skip to content

Most visited

Recently visited

navigation

VoiceInteractor.ConfirmationRequest

public static class VoiceInteractor.ConfirmationRequest
extends VoiceInteractor.Request

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


Confirms an operation with the user via the trusted system VoiceInteractionService. This allows an Activity to complete an unsafe operation that would require the user to touch the screen when voice interaction mode is not enabled. The result of the confirmation will be returned through an asynchronous call to either onConfirmationResult(boolean, android.os.Bundle) or onCancel() - these methods should be overridden to define the application specific behavior.

In some cases this may be a simple yes / no confirmation or the confirmation could include context information about how the action will be completed (e.g. booking a cab might include details about how long until the cab arrives) so the user can give a confirmation.

Summary

Public constructors

VoiceInteractor.ConfirmationRequest(VoiceInteractor.Prompt prompt, Bundle extras)

Create a new confirmation request.

Public methods

void onConfirmationResult(boolean confirmed, Bundle result)

Handle the confirmation result.

Inherited methods

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

Public constructors

VoiceInteractor.ConfirmationRequest

added in API level 23
VoiceInteractor.ConfirmationRequest (VoiceInteractor.Prompt prompt, 
                Bundle extras)

Create a new confirmation request.

Parameters
prompt VoiceInteractor.Prompt: Optional confirmation to speak to the user or null if nothing should be spoken.

extras Bundle: Additional optional information or null.

Public methods

onConfirmationResult

added in API level 23
void onConfirmationResult (boolean confirmed, 
                Bundle result)

Handle the confirmation result. Override this method to define the behavior when the user confirms or rejects the operation.

Parameters
confirmed boolean: Whether the user confirmed or rejected the operation.

result Bundle: Additional result information or null.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.