Stay organized with collections
Save and categorize content based on your preferences.
CompleteVoiceRequest
class CompleteVoiceRequest : VoiceInteractor.Request
Reports that the current interaction was successfully completed with voice, so the application can report the final status to the user. When the response comes back, the voice system has handled the request and is ready to switch; at that point the application can start a new non-voice activity or finish. Be sure when starting the new activity to use Intent.FLAG_ACTIVITY_NEW_TASK
to keep the new activity out of the current voice interaction task.
Summary
Public constructors |
Create a new completed voice interaction request.
|
Public constructors
CompleteVoiceRequest
CompleteVoiceRequest(
prompt: VoiceInteractor.Prompt?,
extras: Bundle?)
Create a new completed voice interaction request.
Parameters |
prompt |
VoiceInteractor.Prompt?: Optional message to speak to the user about the completion status of the task or null if nothing should be spoken. |
extras |
Bundle?: Additional optional information or null. |
Public methods
onCompleteResult
open fun onCompleteResult(result: Bundle!): Unit
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# VoiceInteractor.CompleteVoiceRequest\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCompleteVoiceRequest\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/VoiceInteractor.CompleteVoiceRequest \"View this page in Java\") \n\n```\nclass CompleteVoiceRequest : VoiceInteractor.Request\n```\n\n|---|---|-------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.app.VoiceInteractor.Request](/reference/kotlin/android/app/VoiceInteractor.Request) ||\n| | ↳ | [android.app.VoiceInteractor.CompleteVoiceRequest](#) |\n\nReports that the current interaction was successfully completed with voice, so the application can report the final status to the user. When the response comes back, the voice system has handled the request and is ready to switch; at that point the application can start a new non-voice activity or finish. Be sure when starting the new activity to use [Intent.FLAG_ACTIVITY_NEW_TASK](../content/Intent.html#FLAG_ACTIVITY_NEW_TASK:kotlin.Int) to keep the new activity out of the current voice interaction task.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [CompleteVoiceRequest](#CompleteVoiceRequest(android.app.VoiceInteractor.Prompt,%20android.os.Bundle))`(`prompt:` `[VoiceInteractor.Prompt](/reference/kotlin/android/app/VoiceInteractor.Prompt)?`, `extras:` `[Bundle](../os/Bundle.html#)?`)` Create a new completed voice interaction request. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCompleteResult](#onCompleteResult(android.os.Bundle))`(`result:` `[Bundle](../os/Bundle.html#)!`)` \u003cbr /\u003e |\n\n| Inherited functions ||\n|---|---|\n| From class [Request](/reference/kotlin/android/app/VoiceInteractor.Request) |-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [cancel](/reference/kotlin/android/app/VoiceInteractor.Request#cancel())`()` Cancel this active request. \u003cbr /\u003e | | [Activity](/reference/kotlin/android/app/Activity)! | [getActivity](/reference/kotlin/android/app/VoiceInteractor.Request#getActivity())`()` Return the current [Activity](/reference/kotlin/android/app/Activity) this request is associated with. Will change if the activity is restarted such as through a configuration change. \u003cbr /\u003e | | [Context](../content/Context.html#)! | [getContext](/reference/kotlin/android/app/VoiceInteractor.Request#getContext())`()` Return the current [Context](../content/Context.html#) this request is associated with. May change if the activity hosting it goes through a configuration change. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getName](/reference/kotlin/android/app/VoiceInteractor.Request#getName())`()` Return the name this request was submitted through [submitRequest(android.app.VoiceInteractor.Request,java.lang.String)](/reference/kotlin/android/app/VoiceInteractor#submitRequest(android.app.VoiceInteractor.Request,%20kotlin.String)). \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAttached](/reference/kotlin/android/app/VoiceInteractor.Request#onAttached(android.app.Activity))`(`activity:` `[Activity](/reference/kotlin/android/app/Activity)!`)` The request is now attached to an activity, or being re-attached to a new activity after a configuration change. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCancel](/reference/kotlin/android/app/VoiceInteractor.Request#onCancel())`()` Report from voice interaction service: this operation has been canceled, typically as a completion of a previous call to [cancel](/reference/kotlin/android/app/VoiceInteractor.Request#cancel()) or when the user explicitly cancelled. \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDetached](/reference/kotlin/android/app/VoiceInteractor.Request#onDetached())`()` The request is being detached from an activity. \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](/reference/kotlin/android/app/VoiceInteractor.Request#toString())`()` \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### CompleteVoiceRequest\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCompleteVoiceRequest(\n prompt: VoiceInteractor.Prompt?, \n extras: Bundle?)\n```\n\nCreate a new completed voice interaction request.\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `prompt` | [VoiceInteractor.Prompt](/reference/kotlin/android/app/VoiceInteractor.Prompt)?: Optional message to speak to the user about the completion status of the task or null if nothing should be spoken. |\n| `extras` | [Bundle](../os/Bundle.html#)?: Additional optional information or null. |\n\nPublic methods\n--------------\n\n### onCompleteResult\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onCompleteResult(result: Bundle!): Unit\n```"]]