Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#inhmethods)

# BiometricPrompt.AuthenticationCallback

*** ** * ** ***

` public static abstract class BiometricPrompt.AuthenticationCallback `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.biometrics.BiometricPrompt.AuthenticationCallback |

<br />

*** ** * ** ***

Callback structure provided to `https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt#authenticate(android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.hardware.biometrics.BiometricPrompt.AuthenticationCallback)` or `https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt#authenticate(android.hardware.biometrics.BiometricPrompt.CryptoObject,%20android.os.CancellationSignal,%20java.util.concurrent.Executor,%20android.hardware.biometrics.BiometricPrompt.AuthenticationCallback)`. Users must provide an implementation of this for listening to authentication events.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#AuthenticationCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationError(int,%20java.lang.CharSequence)(int errorCode, https://developer.android.com/reference/java/lang/CharSequence errString) ` Called when an unrecoverable error has been encountered and the operation is complete. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationFailed()() ` Called when a biometric is valid but not recognized. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationHelp(int,%20java.lang.CharSequence)(int helpCode, https://developer.android.com/reference/java/lang/CharSequence helpString) ` Called when a recoverable error has been encountered during authentication. |
| ` void` | ` https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationCallback#onAuthenticationSucceeded(android.hardware.biometrics.BiometricPrompt.AuthenticationResult)(https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.AuthenticationResult result) ` Called when a biometric is recognized. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/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` ` https://developer.android.com/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` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### AuthenticationCallback

```
public AuthenticationCallback ()
```

<br />

<br />

## Public methods

### onAuthenticationError

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

```
public void onAuthenticationError (int errorCode, 
                CharSequence errString)
```

Called when an unrecoverable error has been encountered and the operation is complete. No further actions will be made on this object.

<br />

| Parameters ||
|---|---|
| `errorCode` | `int`: An integer identifying the error message <br /> |
| `errString` | `CharSequence`: A human-readable error string that can be shown on an UI <br /> |

### onAuthenticationFailed

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

```
public void onAuthenticationFailed ()
```

Called when a biometric is valid but not recognized.

<br />

### onAuthenticationHelp

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

```
public void onAuthenticationHelp (int helpCode, 
                CharSequence helpString)
```

Called when a recoverable error has been encountered during authentication. The help string is provided to give the user guidance for what went wrong, such as "Sensor dirty, please clean it."

<br />

| Parameters ||
|---|---|
| `helpCode` | `int`: An integer identifying the error message <br /> |
| `helpString` | `CharSequence`: A human-readable string that can be shown on an UI <br /> |

### onAuthenticationSucceeded

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

```
public void onAuthenticationSucceeded (BiometricPrompt.AuthenticationResult result)
```

Called when a biometric is recognized.

<br />

| Parameters ||
|---|---|
| `result` | `BiometricPrompt.AuthenticationResult`: An object containing authentication-related data <br /> |