anitaa1990 / Biometric-Auth-Sample

Add Biometric Authentication to any Android app
247 stars 142 forks source link

Enable to prevent device back button on Android 9 and above #6

Open onlyrs4u opened 5 years ago

onlyrs4u commented 5 years ago

I am implementing switchcompat when biometric is used. When the biometric prompt is visible and without scanning fingerprint if user presses device back button, prompt gets dismissed. How to prevent device back button when prompt is visible? Need resolution asap.

Sammekl commented 5 years ago

There's no solution for this currently. It's against material design to do such a thing, but if you really need something like this, a quick workaround would be to override [onBackPressed()](https://developer.android.com/reference/android/app/Activity#onBackPressed()) and show the prompt again