Stay organized with collections
Save and categorize content based on your preferences.
AbortVoiceRequest
class AbortVoiceRequest : VoiceInteractor.Request
Reports that the current interaction can not be complete with voice, so the application will need to switch to a traditional input UI. Applications should only use this when they need to completely bail out of the voice interaction and switch to a traditional UI. 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. 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 voice abort request.
|
Public constructors
AbortVoiceRequest
AbortVoiceRequest(
prompt: VoiceInteractor.Prompt?,
extras: Bundle?)
Create a new voice abort request.
Parameters |
prompt |
VoiceInteractor.Prompt?: Optional message to speak to the user indicating why the task could not be completed by voice or null if nothing should be spoken. |
extras |
Bundle?: Additional optional information or null. |
Public methods
onAbortResult
open fun onAbortResult(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.AbortVoiceRequest\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAbortVoiceRequest\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/VoiceInteractor.AbortVoiceRequest \"View this page in Java\") \n\n```\nclass AbortVoiceRequest : 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.AbortVoiceRequest](#) |\n\nReports that the current interaction can not be complete with voice, so the application will need to switch to a traditional input UI. Applications should only use this when they need to completely bail out of the voice interaction and switch to a traditional UI. 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. 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| [AbortVoiceRequest](#AbortVoiceRequest(android.app.VoiceInteractor.Prompt,%20android.os.Bundle))`(`prompt:` `[VoiceInteractor.Prompt](/reference/kotlin/android/app/VoiceInteractor.Prompt)?`, `extras:` `[Bundle](../os/Bundle.html#)?`)` Create a new voice abort request. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onAbortResult](#onAbortResult(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### AbortVoiceRequest\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nAbortVoiceRequest(\n prompt: VoiceInteractor.Prompt?, \n extras: Bundle?)\n```\n\nCreate a new voice abort request.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `prompt` | [VoiceInteractor.Prompt](/reference/kotlin/android/app/VoiceInteractor.Prompt)?: Optional message to speak to the user indicating why the task could not be completed by voice or null if nothing should be spoken. |\n| `extras` | [Bundle](../os/Bundle.html#)?: Additional optional information or null. |\n\nPublic methods\n--------------\n\n### onAbortResult\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onAbortResult(result: Bundle!): Unit\n```"]]