Search code examples
androidandroid-6.0-marshmallowfingerprint

Cancel Fingerprint scanner


I am working on a program that has a security function including a PIN and a fingerprint, but now I'm having a problem with entering the password (PIN or Fingerprint). Incorporating the correct fingerprints is fine, but when I enter the PIN code, after I exit the PIN and fingerprint activity, the machine continues to listen for fingerprints, I know this because when I click on the "home" button "The machine still vibrates slightly, so there is no way to stop listening to fingerprints?


Solution

  • When you start up the fingerprint reader, you pass in a CancellationSignal.

    When you want to cancel (maybe in the OnPause on your Activity), just call the cancel method of this object.

    There is a complete sample here.