Last active
November 16, 2019 14:06
-
-
Save Lavanyagaur22/7f332644bc3dd31f87608bfa5734a984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val biometricPrompt = BiometricPrompt(activity, executor, object : BiometricPrompt.AuthenticationCallback() { | |
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) { | |
super.onAuthenticationError(errorCode, errString) | |
if (errorCode == BiometricPrompt.ERROR_NEGATIVE_BUTTON) { | |
// user clicked negative/cancel button | |
} else { | |
TODO("Called when an unrecoverable error has been encountered and the operation is complete.") | |
} | |
} | |
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) { | |
super.onAuthenticationSucceeded(result) | |
runOnUiThread{ | |
[email protected](Intent(activity,NextActivity::class.java)) | |
} | |
} | |
override fun onAuthenticationFailed() { | |
super.onAuthenticationFailed() | |
runOnUiThread{ | |
Toast.makeText(activity,"Authentication failed! Please try again.", Toast.LENGTH_SHORT).show() | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment