Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# AbortVoiceRequest

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/service/voice/VoiceInteractionSession.AbortVoiceRequest "View this page in Java")

```
class AbortVoiceRequest : VoiceInteractionSession.Request
```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [android.service.voice.VoiceInteractionSession.Request](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request) ||
|   | ↳ | [android.service.voice.VoiceInteractionSession.AbortVoiceRequest](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AbortVoiceRequest#) |

A request to report that the current user interaction can not be completed with voice, as per `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#`.

## Summary

| Public methods ||
|---|---|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AbortVoiceRequest#getMessage()()` Return the message informing the user of the problem, as per `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#`. |
| [VoiceInteractor.Prompt](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt.html#)? | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AbortVoiceRequest#getVoicePrompt()()` Return the message informing the user of the problem, as per `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#`. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AbortVoiceRequest#sendAbortResult(android.os.Bundle)(result: https://developer.android.com/reference/kotlin/android/os/Bundle.html#!)` Report that the voice interactor has finished aborting the voice operation, resulting in a call to `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#onAbortResult(android.os.Bundle)`. |

| Inherited functions ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#cancel()()` Ask the app to cancel this current request. This also finishes the request (it is no longer active). <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingPackage()()` Return the package name of the application that initiated the request. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingUid()()` Return the uid of the application that initiated the request. <br /> | | `https://developer.android.com/reference/kotlin/android/os/Bundle.html#!` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getExtras()()` Return any additional extra information that was supplied as part of the request. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#isActive()()` Check whether this request is currently active. A request becomes inactive after calling `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#cancel()` or a final result method that completes the request. After this point, further interactions with the request will result in `https://developer.android.com/reference/kotlin/java/lang/IllegalStateException.html#` errors; you should not catch these errors, but can use this method if you need to determine the state of the request. Returns true if the request is still active. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#toString()()` Returns a string representation of the object. <br /> | ||

## Public methods

### getMessage

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getMessage(): CharSequence?
```

**Deprecated:** *Prefer `https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.AbortVoiceRequest#getVoicePrompt()` which allows a separate visual message.*

Return the message informing the user of the problem, as per `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#`.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html?` | This value may be `null`. |

### getVoicePrompt

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun getVoicePrompt(): VoiceInteractor.Prompt?
```

Return the message informing the user of the problem, as per `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#`.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt.html#?` | This value may be `null`. |

### sendAbortResult

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun sendAbortResult(result: Bundle!): Unit
```

Report that the voice interactor has finished aborting the voice operation, resulting in a call to `https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.AbortVoiceRequest.html#onAbortResult(android.os.Bundle)`. This finishes the request (it is no longer active).