AuthPromptCallback
public
abstract
class
AuthPromptCallback
extends Object
java.lang.Object | |
↳ | androidx.biometric.auth.AuthPromptCallback |
A collection of methods that may be invoked by an auth prompt during authentication.
Each method receives a reference to the (possibly null
) activity instance that is
currently hosting the prompt. This reference should be used to fetch or update any necessary
activity state in order for changes to be reflected across configuration changes.
Summary
Public constructors | |
---|---|
AuthPromptCallback()
|
Public methods | |
---|---|
void
|
onAuthenticationError(FragmentActivity activity, int errorCode, CharSequence errString)
Called when an unrecoverable error has been encountered and authentication has stopped. |
void
|
onAuthenticationFailed(FragmentActivity activity)
Called when an authentication attempt by the user has been rejected. |
void
|
onAuthenticationSucceeded(FragmentActivity activity, BiometricPrompt.AuthenticationResult result)
Called when the user has successfully authenticated. |
Inherited methods | |
---|---|
Public constructors
AuthPromptCallback
public AuthPromptCallback ()
Public methods
onAuthenticationError
public void onAuthenticationError (FragmentActivity activity, int errorCode, CharSequence errString)
Called when an unrecoverable error has been encountered and authentication has stopped.
After this method is called, no further events will be sent for the current authentication session.
Parameters | |
---|---|
activity |
FragmentActivity : The activity that is currently hosting the prompt. |
errorCode |
int : An integer ID associated with the error. |
errString |
CharSequence : A human-readable string that describes the error.
|
onAuthenticationFailed
public void onAuthenticationFailed (FragmentActivity activity)
Called when an authentication attempt by the user has been rejected.
Parameters | |
---|---|
activity |
FragmentActivity : The activity that is currently hosting the prompt.
|
onAuthenticationSucceeded
public void onAuthenticationSucceeded (FragmentActivity activity, BiometricPrompt.AuthenticationResult result)
Called when the user has successfully authenticated.
After this method is called, no further events will be sent for the current authentication session.
Parameters | |
---|---|
activity |
FragmentActivity : The activity that is currently hosting the prompt. |
result |
BiometricPrompt.AuthenticationResult : An object containing authentication-related data.
|