Search code examples
androidflutterdartauthenticationlockscreen

When I Unlock my phone with my flutter app in the foreground, It bypass authentication


My problem is that when I lock my Android phone with my flutter app in the foreground.

And then I wake the phone up, instead of taking me to the lock screen to give the password to unlock the phone, it takes me right to the flutter app, without any authentication.

How could this be resolved? Have anyone met this problem too?


Solution

  • add android:showWhenLocked="false" to your MainActivity in AndroidManifest.xml

    <activity 
         android:showWhenLocked="false"