Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder that collects arguments, to be shown on the system-provided confirmation prompt.
Summary
Public constructors |
Creates a builder for the confirmation prompt.
|
Public constructors
Builder
Builder(context: Context!)
Creates a builder for the confirmation prompt.
Parameters |
context |
Context!: the application context |
Public methods
build
fun build(): ConfirmationPrompt!
Creates a ConfirmationPrompt
with the arguments supplied to this builder.
Exceptions |
java.lang.IllegalArgumentException |
if any of the required fields are not set. |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ConfirmationPrompt.Builder\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/security/ConfirmationPrompt.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|--------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.security.ConfirmationPrompt.Builder](#) |\n\nA builder that collects arguments, to be shown on the system-provided confirmation prompt.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.content.Context))`(`context:` `[Context](../content/Context.html#)!`)` Creates a builder for the confirmation prompt. |\n\n| Public methods ||\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ConfirmationPrompt](/reference/kotlin/android/security/ConfirmationPrompt)! | [build](#build())`()` Creates a [ConfirmationPrompt](/reference/kotlin/android/security/ConfirmationPrompt) with the arguments supplied to this builder. |\n| [ConfirmationPrompt.Builder](#)! | [setExtraData](#setExtraData(kotlin.ByteArray))`(`extraData:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Sets the extra data for the prompt. |\n| [ConfirmationPrompt.Builder](#)! | [setPromptText](#setPromptText(kotlin.CharSequence))`(`promptText:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Sets the prompt text for the prompt. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(context: Context!)\n```\n\nCreates a builder for the confirmation prompt.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------|\n| `context` | [Context](../content/Context.html#)!: the application context |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ConfirmationPrompt!\n```\n\nCreates a [ConfirmationPrompt](/reference/kotlin/android/security/ConfirmationPrompt) with the arguments supplied to this builder.\n\n| Return ||\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [ConfirmationPrompt](/reference/kotlin/android/security/ConfirmationPrompt)! | a [ConfirmationPrompt](/reference/kotlin/android/security/ConfirmationPrompt) |\n\n| Exceptions ||\n|--------------------------------------|--------------------------------------------|\n| `java.lang.IllegalArgumentException` | if any of the required fields are not set. |\n\n### setExtraData\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setExtraData(extraData: ByteArray!): ConfirmationPrompt.Builder!\n```\n\nSets the extra data for the prompt.\n\n| Parameters ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `extraData` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!: data to include in the response data. |\n\n| Return ||\n|----------------------------------|--------------|\n| [ConfirmationPrompt.Builder](#)! | the builder. |\n\n### setPromptText\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setPromptText(promptText: CharSequence!): ConfirmationPrompt.Builder!\n```\n\nSets the prompt text for the prompt.\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `promptText` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!: the text to present in the prompt. |\n\n| Return ||\n|----------------------------------|--------------|\n| [ConfirmationPrompt.Builder](#)! | the builder. |"]]