I'm trying to detect if the user has enrolled fingerprint or not in Android Pie using BiometricPrompt
but this class will show the dialog and I want only to return true or false without any dialog.
Code
public boolean hasEnrolledFingerprints() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
//How can I return true or false without showing dialog using BiometricPrompt
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
FingerprintManager fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
return fingerprintManager.hasEnrolledFingerprints();
}
return false;
}