# VoiceInteractionSession.ConfirmationRequest

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

# ConfirmationRequest

*** ** * ** ***

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

```
class ConfirmationRequest : 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.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ConfirmationRequest#) |

A request for confirmation from the user of an operation, as per[VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?                     | [getPrompt](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ConfirmationRequest#getPrompt())`()` Return the prompt informing the user of what will happen, as per[VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#).                                                                                                                                                                                                                                                                                                                                                                              |
| [VoiceInteractor.Prompt](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.Prompt.html#)? | [getVoicePrompt](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ConfirmationRequest#getVoicePrompt())`()` Return the prompt informing the user of what will happen, as per[VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#).                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                       | [sendConfirmationResult](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ConfirmationRequest#sendConfirmationResult(kotlin.Boolean,%20android.os.Bundle))`(`confirmed:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `result:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` Report that the voice interactor has confirmed the operation with the user, resulting in a call to[VoiceInteractor.ConfirmationRequest.onConfirmationResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#onConfirmationResult(kotlin.Boolean,%20android.os.Bundle)). |

| Inherited functions ||
|---|---|
| From class[Request](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request) |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [cancel](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#cancel())`()` <br /> Ask the app to cancel this current request. This also finishes the request (it is no longer active). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!  | [getCallingPackage](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingPackage())`()` <br /> Return the package name of the application that initiated the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [getCallingUid](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getCallingUid())`()` <br /> Return the uid of the application that initiated the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!  | [getExtras](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#getExtras())`()` <br /> Return any additional extra information that was supplied as part of the request. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isActive](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#isActive())`()` <br /> Check whether this request is currently active. A request becomes inactive after calling[cancel](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[java.lang.IllegalStateException](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 /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.Request#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | ||

## Public methods

### getPrompt

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 getPrompt(): CharSequence?
```

**Deprecated:** *Prefer[getVoicePrompt()](https://developer.android.com/reference/kotlin/android/service/voice/VoiceInteractionSession.ConfirmationRequest#getVoicePrompt())which allows multiple voice prompts.*

Return the prompt informing the user of what will happen, as per[VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#).

|                                                          Return                                                          ||
|------------------------------------------------------------------------------------------------|--------------------------|
| [CharSequence](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 prompt informing the user of what will happen, as per[VoiceInteractor.ConfirmationRequest](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#).

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

### sendConfirmationResult

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

```
fun sendConfirmationResult(
    confirmed: Boolean, 
    result: Bundle!
): Unit
```

Report that the voice interactor has confirmed the operation with the user, resulting in a call to[VoiceInteractor.ConfirmationRequest.onConfirmationResult](https://developer.android.com/reference/kotlin/android/app/VoiceInteractor.ConfirmationRequest.html#onConfirmationResult(kotlin.Boolean,%20android.os.Bundle)). This finishes the request (it is no longer active).