On a Xiaomi Redmi Note 9 Pro we try to open the fingerprint enrollment with the following code:
val intent = Intent(Settings.ACTION_FINGERPRINT_ENROLL)
startActivityForResult(intent, SETTINGS_FINGERPRINT_ENROLLMENT_REQUESTCODE)
This result in the following exception
java.lang.RuntimeException:
Unable to start activity ComponentInfo{com.android.settings/com.android.settings.biometrics.fingerprint.FingerprintEnrollIntroduction}:
java.lang.IllegalStateException:
You need to use a miui theme (or descendant) with this activity.
We call the code in a try/catch
but it still crashes our top most activity.
Am I forced to use the miui theme in my app to start the fingerprint enrollment? It's not an option to change our app theme to miui theme to fix this issue.
Is there a special intent action introduced by Xiaomi or another way of achieving the fingerprint enrollment?
Using Intent(Settings.ACTION_SECURITY_SETTINGS)
to open the security settings does not solve the problem since it seems that there is no option available to add a fingerprint