public static class VoiceInteractor.ConfirmationRequest
extends VoiceInteractor.Request
| java.lang.Object | ||
| android.app.VoiceInteractor.Request | ||
| android.app.VoiceInteractor.ConfirmationRequest | ||
通过可信系统VoiceInteractionService确认与用户的操作。 这允许活动完成不安全的操作,当语音交互模式未启用时,需要用户触摸屏幕。 确认的结果将通过对onConfirmationResult(boolean, android.os.Bundle)或onCancel()的异步调用返回 - 应重写这些方法以定义特定于应用程序的行为。
在某些情况下,这可能是一个简单的是/否确认,或者确认可能包括有关如何完成操作的上下文信息(例如,预订出租车可能包括有关出租车到达之前多长时间的详细信息),以便用户可以进行确认。
Public constructors |
|
|---|---|
VoiceInteractor.ConfirmationRequest(VoiceInteractor.Prompt prompt, Bundle extras) 创建一个新的确认请求。 |
|
公共方法(Public methods) |
|
|---|---|
void |
onConfirmationResult(boolean confirmed, Bundle result) 处理确认结果。 |
继承方法(Inherited methods) |
|
|---|---|
android.app.VoiceInteractor.Request
|
|
java.lang.Object
|
|
VoiceInteractor.ConfirmationRequest (VoiceInteractor.Prompt prompt, Bundle extras)
创建一个新的确认请求。
| 参数(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. |
void onConfirmationResult (boolean confirmed,
Bundle result)
处理确认结果。 重写此方法以定义用户确认或拒绝操作时的行为。
| 参数(Parameters) | |
|---|---|
confirmed |
boolean: Whether the user confirmed or rejected the operation. |
result |
Bundle: Additional result information or null. |