简体   繁体   中英

No Activity found to handle Intent { act=android.settings.BIOMETRIC_ENROLL (has extras) }

I am implementing fingerprint authentication on my app. If the user hasn't set up a fingerprint on his device. I am trying to open system settings for enrolling fingerprints. According to documentation( https://developer.android.com/training/sign-in/biometric-auth ), this is the code for opening the setting activity for enrolling fingerprint.

 final Intent enrollIntent = new Intent(Settings.ACTION_BIOMETRIC_ENROLL);
    enrollIntent.putExtra(Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED,
            BIOMETRIC_STRONG | DEVICE_CREDENTIAL);
    startActivityForResult(enrollIntent, REQUEST_CODE);

I have tested the app on two devices. In Samsung, the code is working. But in an Asus device, it is not working.

As in the Google documentation "ACTION_BIOMETRIC_ENROLL" added at API 30, that's what causes your app to crash

Make sure that you have added a fingerprint in device it will work (in sha'a Allah)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM