PromptContentViewWithMoreOptionsButton


public final class PromptContentViewWithMoreOptionsButton
extends Object implements PromptContentView, Parcelable

java.lang.Object
   ↳ android.hardware.biometrics.PromptContentViewWithMoreOptionsButton


Contains the information of the template of content view with a more options button for Biometric Prompt.

This button should be used to provide more options for sign in or other purposes, such as when a user needs to select between multiple app-specific accounts or profiles that are available for sign in.

Apps should avoid using this when possible because it will create additional steps that the user must navigate through - clicking the more options button will dismiss the prompt, provide the app an opportunity to ask the user for the correct option, and finally allow the app to decide how to proceed once selected.

Here's how you'd set a PromptContentViewWithMoreOptionsButton on a Biometric Prompt:

 BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(...)
     .setTitle(...)
     .setSubTitle(...)
     .setContentView(new PromptContentViewWithMoreOptionsButton.Builder()
         .setDescription("test description")
         .setMoreOptionsButtonListener(executor, listener)
         .build())
     .build();
 

Summary

Nested classes

class PromptContentViewWithMoreOptionsButton.Builder

A builder that collects arguments to be shown on the content view with more options button. 

Inherited constants

Fields

public static final Creator<PromptContentViewWithMoreOptionsButton> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String getDescription()

Gets the description for the content view, as set by PromptContentViewWithMoreOptionsButton.Builder#setDescription(String).

DialogInterface.OnClickListener getMoreOptionsButtonListener()

Gets the click listener for the more options button on the content view, as set by PromptContentViewWithMoreOptionsButton.Builder#setMoreOptionsButtonListener(Executor, DialogInterface.OnClickListener).

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getDescription

public String getDescription ()

Gets the description for the content view, as set by PromptContentViewWithMoreOptionsButton.Builder#setDescription(String).
Requires Manifest.permission.SET_BIOMETRIC_DIALOG_ADVANCED

Returns
String The description for the content view, or null if the content view has no description.

getMoreOptionsButtonListener

public DialogInterface.OnClickListener getMoreOptionsButtonListener ()

Gets the click listener for the more options button on the content view, as set by PromptContentViewWithMoreOptionsButton.Builder#setMoreOptionsButtonListener(Executor, DialogInterface.OnClickListener).
Requires Manifest.permission.SET_BIOMETRIC_DIALOG_ADVANCED

Returns
DialogInterface.OnClickListener The click listener for the more options button on the content view. This value cannot be null.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES