Stay organized with collections
Save and categorize content based on your preferences.
ConfirmationPrompt.Builder
public
static
final
class
ConfirmationPrompt.Builder
extends Object
A builder that collects arguments, to be shown on the system-provided confirmation prompt.
Summary
Public constructors |
Builder(Context context)
Creates a builder for the confirmation prompt.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
Builder
public Builder (Context context)
Creates a builder for the confirmation prompt.
Parameters |
context |
Context : the application context |
Public methods
public ConfirmationPrompt.Builder setExtraData (byte[] extraData)
Sets the extra data for the prompt.
Parameters |
extraData |
byte : data to include in the response data. |
setPromptText
public ConfirmationPrompt.Builder setPromptText (CharSequence promptText)
Sets the prompt text for the prompt.
Parameters |
promptText |
CharSequence : the text to present in the prompt. |
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,["# ConfirmationPrompt.Builder\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nConfirmationPrompt.Builder\n==========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/security/ConfirmationPrompt.Builder \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\nfinal\n\nclass\nConfirmationPrompt.Builder\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.security.ConfirmationPrompt.Builder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\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](/reference/android/security/ConfirmationPrompt.Builder#Builder(android.content.Context))`(`[Context](/reference/android/content/Context)` context) ` Creates a builder for the confirmation prompt. |\n\n| ### Public methods ||\n|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[ConfirmationPrompt](/reference/android/security/ConfirmationPrompt) | ` `[build](/reference/android/security/ConfirmationPrompt.Builder#build())`() ` Creates a [ConfirmationPrompt](/reference/android/security/ConfirmationPrompt) with the arguments supplied to this builder. |\n| ` `[ConfirmationPrompt.Builder](/reference/android/security/ConfirmationPrompt.Builder) | ` `[setExtraData](/reference/android/security/ConfirmationPrompt.Builder#setExtraData(byte[]))`(byte[] extraData) ` Sets the extra data for the prompt. |\n| ` `[ConfirmationPrompt.Builder](/reference/android/security/ConfirmationPrompt.Builder) | ` `[setPromptText](/reference/android/security/ConfirmationPrompt.Builder#setPromptText(java.lang.CharSequence))`(`[CharSequence](/reference/java/lang/CharSequence)` promptText) ` Sets the prompt text for the prompt. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Builder (Context context)\n```\n\nCreates a builder for the confirmation prompt.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-------------------------------------------|\n| `context` | `Context`: the application context \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ConfirmationPrompt build ()\n```\n\nCreates a [ConfirmationPrompt](/reference/android/security/ConfirmationPrompt) with the arguments supplied to this builder.\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [ConfirmationPrompt](/reference/android/security/ConfirmationPrompt) | a [ConfirmationPrompt](/reference/android/security/ConfirmationPrompt) \u003cbr /\u003e |\n\n| Throws ||\n|---------------------------------------------------------------------------|--------------------------------------------|\n| [IllegalArgumentException](/reference/java/lang/IllegalArgumentException) | if any of the required fields are not set. |\n\n### setExtraData\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ConfirmationPrompt.Builder setExtraData (byte[] extraData)\n```\n\nSets the extra data for the prompt.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|------------------------------------------------------|\n| `extraData` | `byte`: data to include in the response data. \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------|---------------------|\n| [ConfirmationPrompt.Builder](/reference/android/security/ConfirmationPrompt.Builder) | the builder. \u003cbr /\u003e |\n\n### setPromptText\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ConfirmationPrompt.Builder setPromptText (CharSequence promptText)\n```\n\nSets the prompt text for the prompt.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|-----------------------------------------------------------|\n| `promptText` | `CharSequence`: the text to present in the prompt. \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------|---------------------|\n| [ConfirmationPrompt.Builder](/reference/android/security/ConfirmationPrompt.Builder) | the builder. \u003cbr /\u003e |"]]