BiometricPrompt.PromptInfo.Builder

public static class BiometricPrompt.PromptInfo.Builder
extends Object

java.lang.Object
   ↳ androidx.biometrics.BiometricPrompt.PromptInfo.Builder


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

Summary

Public constructors

BiometricPrompt.PromptInfo.Builder()

Public methods

BiometricPrompt.PromptInfo build()

Creates a BiometricPrompt.

BiometricPrompt.PromptInfo.Builder setDescription(CharSequence description)

Optional: Set the description to display.

BiometricPrompt.PromptInfo.Builder setNegativeButtonText(CharSequence text)

Required: Set the text for the negative button.

BiometricPrompt.PromptInfo.Builder setSubtitle(CharSequence subtitle)

Optional: Set the subtitle to display.

BiometricPrompt.PromptInfo.Builder setTitle(CharSequence title)

Required: Set the title to display.

Inherited methods

Public constructors

BiometricPrompt.PromptInfo.Builder

public BiometricPrompt.PromptInfo.Builder ()

Public methods

build

public BiometricPrompt.PromptInfo build ()

Creates a BiometricPrompt.

Returns
BiometricPrompt.PromptInfo a BiometricPrompt

Throws
IllegalArgumentException if any of the required fields are not set.

setDescription

public BiometricPrompt.PromptInfo.Builder setDescription (CharSequence description)

Optional: Set the description to display.

Parameters
description CharSequence

Returns
BiometricPrompt.PromptInfo.Builder

setNegativeButtonText

public BiometricPrompt.PromptInfo.Builder setNegativeButtonText (CharSequence text)

Required: Set the text for the negative button. This would typically be used as a "Cancel" button, but may be also used to show an alternative method for authentication, such as screen that asks for a backup password.

Returns
BiometricPrompt.PromptInfo.Builder

setSubtitle

public BiometricPrompt.PromptInfo.Builder setSubtitle (CharSequence subtitle)

Optional: Set the subtitle to display.

Parameters
subtitle CharSequence

Returns
BiometricPrompt.PromptInfo.Builder

setTitle

public BiometricPrompt.PromptInfo.Builder setTitle (CharSequence title)

Required: Set the title to display.

Parameters
title CharSequence

Returns
BiometricPrompt.PromptInfo.Builder