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

# Builder

*** ** * ** ***

```
open class Builder
```

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

A builder that collects arguments to be shown on the system-provided biometric dialog.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#Builder(android.content.Context)(context: https://developer.android.com/reference/kotlin/android/content/Context.html#!)` Creates a builder for a `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` dialog. |

| Public methods ||
|---|---|
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#addFallbackOption(kotlin.CharSequence,%20kotlin.Int,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)(text: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html, iconType: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, executor: https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#, listener: https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnClickListener.html#)` Optional: Sets the text, icon, executor, and click listener for a fallback option in biometric prompt. |
| open [BiometricPrompt](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#build()()` Creates a `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt`. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)(authenticators: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Optional: Specifies the type(s) of authenticators that may be invoked by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` to authenticate the user. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAuthenticationPurpose(kotlin.Int)(purpose: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Optional: Sets the authentication purpose for the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setConfirmationRequired(kotlin.Boolean)(requireConfirmation: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Optional: Sets a hint to the system for whether to require user confirmation after authentication. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setContentView(android.hardware.biometrics.PromptContentView)(view: https://developer.android.com/reference/kotlin/android/hardware/biometrics/PromptContentView)` Optional: Sets application customized content view that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDescription(kotlin.CharSequence)(description: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)` Optional: Sets a description that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDeviceCredentialAllowed(kotlin.Boolean)(allowed: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Optional: If enabled, the user will be given the option to authenticate with their device PIN, pattern, or password. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setLogoBitmap(android.graphics.Bitmap)(logoBitmap: https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)` Optional: Sets the bitmap drawable of the logo that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setLogoDescription(kotlin.String)(logoDescription: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Optional: Sets logo description text that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setLogoRes(kotlin.Int)(logoRes: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Optional: Sets the drawable resource of the logo that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setNegativeButton(kotlin.CharSequence,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)(text: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html, executor: https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#, listener: https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnClickListener.html#)` Optional: Sets the text, executor, and click listener for the negative button on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setSubtitle(kotlin.CharSequence)(subtitle: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)` Optional: Sets a subtitle that will be shown on the prompt. |
| open [BiometricPrompt.Builder](https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setTitle(kotlin.CharSequence)(title: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)` Required: Sets the title that will be shown on 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 a `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` dialog.

| Parameters ||
|---|---|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!: The `https://developer.android.com/reference/kotlin/android/content/Context.html#` that will be used to build the prompt. |

## Public methods

### addFallbackOption

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

```
open fun addFallbackOption(
    text: CharSequence, 
    iconType: Int, 
    executor: Executor, 
    listener: DialogInterface.OnClickListener
): BiometricPrompt.Builder
```

Optional: Sets the text, icon, executor, and click listener for a fallback option in biometric prompt.

Fallback option is displayed as the negative button in prompt authentication screen if it is the only option and will display in a list in the fallback options page if there are more than one. If device credential authentication is allowed through `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)`, it will count as a fallback option.

If a fallback option is not provided and `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setNegativeButton(kotlin.CharSequence,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)` is not set, the option to use device credential will be shown as the negative button if allowed in `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)`. If credential is not allowed, "Cancel" will be shown as the negative button.

A maximum of `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt#getMaxFallbackOptions()` fallback options can be added. This number does not include device credential authentication.

**Note: These fallback options will not be displayed if `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setNegativeButton(kotlin.CharSequence,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)` is set**

| Parameters ||
|---|---|
| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): Text to be shown on the fallback option for the prompt. This value cannot be `null`. |
| `iconType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Icon to be shown for the fallback option. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_PASSWORD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_QR_CODE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_ACCOUNT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_GENERIC:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_SETTING:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_RESET:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_MESSAGE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#ICON_TYPE_SUPERVISED:kotlin.Int` |
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#): Executor that will be used to run the on click callback. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#` that dispatches to an appropriate thread. |
| `listener` | [DialogInterface.OnClickListener](https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnClickListener.html#): Listener containing a callback to be run when the button is pressed. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### build

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

```
open fun build(): BiometricPrompt
```

Creates a `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt`.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` | An instance of `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt`. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | If any required fields are unset, or if given any invalid combination of field values. |

### setAllowedAuthenticators

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

```
open fun setAllowedAuthenticators(authenticators: Int): BiometricPrompt.Builder
```

Optional: Specifies the type(s) of authenticators that may be invoked by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` to authenticate the user. Available authenticator types are defined in `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators` and can be combined via bitwise OR. Defaults to:

- `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#BIOMETRIC_WEAK:kotlin.Int` for non-crypto authentication, or
- `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#BIOMETRIC_STRONG:kotlin.Int` for crypto-based authentication.

<br />

If this method is used and no authenticator of any of the specified types is available at the time `BiometricPrompt#authenticate(...)` is called, authentication will be canceled and `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationError(kotlin.Int,%20kotlin.CharSequence)` will be invoked with an appropriate error code.

This method should be preferred over `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDeviceCredentialAllowed(kotlin.Boolean)` and overrides the latter if both are used. Using this method to enable device credential authentication (with `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#DEVICE_CREDENTIAL:kotlin.Int`) will replace the negative button on the prompt, making it an error to also call `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setNegativeButton(kotlin.CharSequence,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)`.

If unlocking cryptographic operation(s), it is the application's responsibility to request authentication with the proper set of authenticators (e.g. match the authenticators specified during key generation).

| Parameters ||
|---|---|
| `authenticators` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A bit field representing all valid authenticator types that may be invoked by the prompt. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#BIOMETRIC_STRONG:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#BIOMETRIC_WEAK:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#DEVICE_CREDENTIAL:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#IDENTITY_CHECK:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/security/keystore/KeyGenParameterSpec.Builder.html#`
- `https://developer.android.com/reference/kotlin/android/security/keystore/KeyProperties.html#AUTH_BIOMETRIC_STRONG:kotlin.Int`
- `https://developer.android.com/reference/kotlin/android/security/keystore/KeyProperties.html#AUTH_DEVICE_CREDENTIAL:kotlin.Int`

### setAuthenticationPurpose

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

```
open fun setAuthenticationPurpose(purpose: Int): BiometricPrompt.Builder
```

Optional: Sets the authentication purpose for the prompt.

Provides a hint to customize the `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt` appearance to clarify what the user is authorizing. This is cosmetic only, can vary by device, and does not change security guarantees (see `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)`).

For example, this may inform the user to click or tap "to pay" instead of "to authenticate".

| Parameters ||
|---|---|
| `purpose` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The authentication purpose to set. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#AUTHENTICATION_PURPOSE_UNKNOWN:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#AUTHENTICATION_PURPOSE_PAYMENT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#AUTHENTICATION_PURPOSE_LOGIN:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setConfirmationRequired

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

```
open fun setConfirmationRequired(requireConfirmation: Boolean): BiometricPrompt.Builder
```

Optional: Sets a hint to the system for whether to require user confirmation after authentication. For example, implicit modalities like face and iris are passive, meaning they don't require an explicit user action to complete authentication. If set to true, these modalities should require the user to take some action (e.g. press a button) before `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationSucceeded(android.hardware.biometrics.BiometricPrompt.AuthenticationResult)` is called. Defaults to true.

A typical use case for not requiring confirmation would be for low-risk transactions, such as re-authenticating a recently authenticated application. A typical use case for requiring confirmation would be for authorizing a purchase.

Note that this just passes a hint to the system, which the system may then ignore. For example, a value of false may be ignored if the user has disabled implicit authentication in Settings, or if it does not apply to a particular modality (e.g. fingerprint).

| Parameters ||
|---|---|
| `requireConfirmation` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): true if explicit user confirmation should be required, or false otherwise. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setContentView

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

```
open fun setContentView(view: PromptContentView): BiometricPrompt.Builder
```

Optional: Sets application customized content view that will be shown on the prompt.

Note that the description set by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDescription(kotlin.CharSequence)` will be overridden by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setContentView(android.hardware.biometrics.PromptContentView)`. The view provided to `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setContentView(android.hardware.biometrics.PromptContentView)` will be used if both methods are called.

| Parameters ||
|---|---|
| `view` | [PromptContentView](https://developer.android.com/reference/kotlin/android/hardware/biometrics/PromptContentView): The customized view information. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setDescription

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

```
open fun setDescription(description: CharSequence): BiometricPrompt.Builder
```

Optional: Sets a description that will be shown on the prompt.

Note that the description set by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDescription(kotlin.CharSequence)` will be overridden by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setContentView(android.hardware.biometrics.PromptContentView)`. The view provided to `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setContentView(android.hardware.biometrics.PromptContentView)` will be used if both methods are called.

| Parameters ||
|---|---|
| `description` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): The description to display. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setDeviceCredentialAllowed

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

```
open fun setDeviceCredentialAllowed(allowed: Boolean): BiometricPrompt.Builder
```

**Deprecated:** *Replaced by `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)`.*

Optional: If enabled, the user will be given the option to authenticate with their device PIN, pattern, or password. Developers should first check `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager#canAuthenticate(kotlin.Int)` for `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricManager.Authenticators#DEVICE_CREDENTIAL:kotlin.Int` before enabling. If the device is not secured with a credential, `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationError(kotlin.Int,%20kotlin.CharSequence)` will be invoked with `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt#BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL:kotlin.Int`. Defaults to false.

Note that enabling this option replaces the negative button on the prompt with one that allows the user to authenticate with their device credential, making it an error to call `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setNegativeButton(kotlin.CharSequence,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)`.

| Parameters ||
|---|---|
| `allowed` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): true if the prompt should fall back to asking for the user's device credential (PIN/pattern/password), or false otherwise. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setLogoBitmap

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

```
open fun setLogoBitmap(logoBitmap: Bitmap): BiometricPrompt.Builder
```

Optional: Sets the bitmap drawable of the logo that will be shown on the prompt.

Note that using this method is not recommended in most scenarios because the calling application's icon will be used by default. Setting the logo is intended for large bundled applications that perform a wide range of functions and need to show distinct icons for each function.   
Requires `https://developer.android.com/reference/kotlin/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED:kotlin.String`

| Parameters ||
|---|---|
| `logoBitmap` | [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#): A bitmap drawable of the logo that will be shown on the prompt. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setLogoDescription

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

```
open fun setLogoDescription(logoDescription: String): BiometricPrompt.Builder
```

Optional: Sets logo description text that will be shown on the prompt.

Note that using this method is not recommended in most scenarios because the calling application's name will be used by default. Setting the logo description is intended for large bundled applications that perform a wide range of functions and need to show distinct description for each function.   
Requires `https://developer.android.com/reference/kotlin/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED:kotlin.String`

| Parameters ||
|---|---|
| `logoDescription` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The logo description text that will be shown on the prompt. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | If logo description is null. |

### setLogoRes

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

```
open fun setLogoRes(logoRes: Int): BiometricPrompt.Builder
```

Optional: Sets the drawable resource of the logo that will be shown on the prompt.

Note that using this method is not recommended in most scenarios because the calling application's icon will be used by default. Setting the logo is intended for large bundled applications that perform a wide range of functions and need to show distinct icons for each function.   
Requires `https://developer.android.com/reference/kotlin/android/Manifest.permission.html#SET_BIOMETRIC_DIALOG_ADVANCED:kotlin.String`

| Parameters ||
|---|---|
| `logoRes` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A drawable resource of the logo that will be shown on the prompt. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setNegativeButton

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

```
open fun setNegativeButton(
    text: CharSequence, 
    executor: Executor, 
    listener: DialogInterface.OnClickListener
): BiometricPrompt.Builder
```

Optional: Sets the text, executor, and click listener for the negative button on the prompt. This is typically a cancel button, but may be also used to show an alternative method for authentication, such as a screen that asks for a backup password.

If not provided and no fallback is added through `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#addFallbackOption(kotlin.CharSequence,%20kotlin.Int,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)` (API 36.1 and later), the option to use device credential will be shown as the negative button if allowed in `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)`. If credential is not allowed, "Cancel" will be shown as the negative button.

In API 36 and earlier, this setting is required. Note that this setting is not required, and in fact is explicitly disallowed, if device credential authentication is enabled via `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(kotlin.Int)` or `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#setDeviceCredentialAllowed(kotlin.Boolean)`. To use credential authentication and provide custom behavior, use `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#addFallbackOption(kotlin.CharSequence,%20kotlin.Int,%20java.util.concurrent.Executor,%20android.content.DialogInterface.OnClickListener)`

| Parameters ||
|---|---|
| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): Text to be shown on the negative button for the prompt. This value cannot be `null`. |
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#): Executor that will be used to run the on click callback. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#` that dispatches to an appropriate thread. |
| `listener` | [DialogInterface.OnClickListener](https://developer.android.com/reference/kotlin/android/content/DialogInterface.OnClickListener.html#): Listener containing a callback to be run when the button is pressed. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setSubtitle

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

```
open fun setSubtitle(subtitle: CharSequence): BiometricPrompt.Builder
```

Optional: Sets a subtitle that will be shown on the prompt.

| Parameters ||
|---|---|
| `subtitle` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): The subtitle to display. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |

### setTitle

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

```
open fun setTitle(title: CharSequence): BiometricPrompt.Builder
```

Required: Sets the title that will be shown on the prompt.

| Parameters ||
|---|---|
| `title` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): The title to display. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/biometrics/BiometricPrompt.Builder#` | This builder. This value cannot be `null`. |