Android Fingerprints: hasEnrolledFingerprints triggers exception on some Samsungs

前端 未结 1 1456
囚心锁ツ
囚心锁ツ 2021-02-13 02:06

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:58

    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)
提交回复
热议问题