Open adhikari-jagdish opened 6 years ago
com.mtramin.rxfingerprint.data.FingerprintAuthenticationException: Fingerprint operation canceled. at com.mtramin.rxfingerprint.FingerprintObservable$2.onAuthenticationError(FingerprintObservable.java:89) at android.hardware.fingerprint.FingerprintManager$MyHandler.sendErrorResult(FingerprintManager.java:1188) at android.hardware.fingerprint.FingerprintManager$MyHandler.handleMessage(FingerprintManager.java:1154) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) D/LoginActivity: Fingerprint operation canceled.
@adhikari-jagdish try this approach: Use dispose() each time when you finish your work with fingerprint.
class SomeClass {
private var subscription: Disposable? = null
fun encrypt(context: Context, fingerKey: String, pin: String) {
subscription = RxFingerprint.encrypt(context, fingerKey, pin)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ result: FingerprintEncryptionResult ->
//TODO: add code for onNext
}, { exception: Throwable ->
//TODO: add code for onError
}, {
//TODO: add code for onComplete
})
}
fun onFinish() {
subscription?.dispose()
}
}
com.mtramin.rxfingerprint.data.FingerprintAuthenticationException: Fingerprint operation canceled. at com.mtramin.rxfingerprint.FingerprintObservable$2.onAuthenticationError(FingerprintObservable.java:89) at android.hardware.fingerprint.FingerprintManager$MyHandler.sendErrorResult(FingerprintManager.java:1188) at android.hardware.fingerprint.FingerprintManager$MyHandler.handleMessage(FingerprintManager.java:1154) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) D/LoginActivity: Fingerprint operation canceled.