Android Fingerprints: hasEnrolledFingerprints triggers exception on some Samsungs

前端 未结 1 620
孤街浪徒
孤街浪徒 2021-02-13 02:09

I\'m seeing a lot of exceptions in our production app when enabling fingerprints coming from Android 6 users, which I cannot reproduce on any of my local Samsung devices. The st

1条回答
  •  囚心锁ツ
    2021-02-13 02:37

    I came across the same problem on a Samsung Galaxy S6, running Android 6.0.1

    The Problem was caused by calling

    fingerprintManager.hasEnrolledFingerprints()
    

    I fixed it by adding a call to check for hardware before:

    fingerprintManager.isHardwareDetected()
        && mFingerprintManager.hasEnrolledFingerprints()
    

    Checking for fingerprints without the hardware available seems to cause this exception on some devices.

    0 讨论(0)
提交回复
热议问题