Skip to content

Instantly share code, notes, and snippets.

@Iltwats
Created May 23, 2021 17:50
Show Gist options
  • Save Iltwats/42f87a8fd9ec0aa20490480d92ce040d to your computer and use it in GitHub Desktop.
Save Iltwats/42f87a8fd9ec0aa20490480d92ce040d to your computer and use it in GitHub Desktop.
Executor executor = ContextCompat.getMainExecutor(this);
BiometricPrompt biometricPrompt = new BiometricPrompt(this, executor, new BiometricPrompt.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
super.onAuthenticationError(errorCode, errString);
viewEditAndSave();
}
@Override
public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
authComplete = true;
viewEditAndSave();
super.onAuthenticationSucceeded(result);
}
@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment