# ConfirmationPrompt.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/security/ConfirmationPrompt.Builder "View this page in Java")  

```
class Builder
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                             ||
| ↳ | [android.security.ConfirmationPrompt.Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#) |

A builder that collects arguments, to be shown on the system-provided confirmation prompt.

## Summary

|                                                                                                                                        Public constructors                                                                                                                                        ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#Builder(android.content.Context))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`)` Creates a builder for the confirmation prompt. |

|                                                                                                                                                                                                          Public methods                                                                                                                                                                                                           ||
|----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ConfirmationPrompt](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt)!                  | [build](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#build())`()` Creates a[ConfirmationPrompt](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt)with the arguments supplied to this builder.                         |
| [ConfirmationPrompt.Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#)! | [setExtraData](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#setExtraData(kotlin.ByteArray))`(`extraData:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Sets the extra data for the prompt.              |
| [ConfirmationPrompt.Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#)! | [setPromptText](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#setPromptText(kotlin.CharSequence))`(`promptText:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Sets the prompt text for the prompt. |

## Public constructors

### Builder

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

```
Builder(context: Context!)
```

Creates a builder for the confirmation prompt.

|                                                         Parameters                                                          ||
|-----------|------------------------------------------------------------------------------------------------------------------|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!:the application context |

## Public methods

### build

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

```
fun build(): ConfirmationPrompt!
```

Creates a[ConfirmationPrompt](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt)with the arguments supplied to this builder.

|                                                                                                        Return                                                                                                        ||
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| [ConfirmationPrompt](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt)! | a[ConfirmationPrompt](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt) |

|                                    Exceptions                                    ||
|--------------------------------------|--------------------------------------------|
| `java.lang.IllegalArgumentException` | if any of the required fields are not set. |

### setExtraData

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

```
fun setExtraData(extraData: ByteArray!): ConfirmationPrompt.Builder!
```

Sets the extra data for the prompt.

|                                                                 Parameters                                                                  ||
|-------------|--------------------------------------------------------------------------------------------------------------------------------|
| `extraData` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!:data to include in the response data. |

|                                                                  Return                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------|--------------|
| [ConfirmationPrompt.Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#)! | the builder. |

### setPromptText

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

```
fun setPromptText(promptText: CharSequence!): ConfirmationPrompt.Builder!
```

Sets the prompt text for the prompt.

|                                                                   Parameters                                                                    ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `promptText` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!:the text to present in the prompt. |

|                                                                  Return                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------|--------------|
| [ConfirmationPrompt.Builder](https://developer.android.com/reference/kotlin/android/security/ConfirmationPrompt.Builder#)! | the builder. |