diff --git a/src/keepass2android/EntryActivity.cs b/src/keepass2android/EntryActivity.cs index 07015231..b7d2bc2a 100644 --- a/src/keepass2android/EntryActivity.cs +++ b/src/keepass2android/EntryActivity.cs @@ -94,7 +94,7 @@ namespace keepass2android Database db = App.Kp2a.GetDb(); // Likely the app has been killed exit the activity - if (! db.Loaded) + if (!db.Loaded || (App.Kp2a.QuickLocked)) { Finish(); return; diff --git a/src/keepass2android/QuickUnlock.cs b/src/keepass2android/QuickUnlock.cs index f516bc27..151cc671 100644 --- a/src/keepass2android/QuickUnlock.cs +++ b/src/keepass2android/QuickUnlock.cs @@ -65,15 +65,11 @@ namespace keepass2android txtLabel.Text = GetString(Resource.String.QuickUnlock_label, new Java.Lang.Object[]{quickUnlockLength}); - EditText pwd= (EditText)FindViewById(Resource.Id.QuickUnlock_password); - pwd.SetEms(quickUnlockLength); - pwd.PostDelayed(() => { - InputMethodManager keyboard = (InputMethodManager)GetSystemService(Context.InputMethodService); - keyboard.ShowSoftInput(pwd, 0); - }, 50); - SetResult(KeePass.ExitChangeDb); - + + EditText pwd = (EditText)FindViewById(Resource.Id.QuickUnlock_password); + pwd.SetEms(quickUnlockLength); + Button btnUnlock = (Button)FindViewById(Resource.Id.QuickUnlock_button); btnUnlock.Click += (object sender, EventArgs e) => { @@ -110,6 +106,14 @@ namespace keepass2android Finish(); return; } + + EditText pwd = (EditText)FindViewById(Resource.Id.QuickUnlock_password); + pwd.PostDelayed(() => + { + InputMethodManager keyboard = (InputMethodManager)GetSystemService(Context.InputMethodService); + keyboard.ShowSoftInput(pwd, 0); + }, 50); + } } } diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index 58f49862..7d38895b 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -64,7 +64,7 @@ namespace keepass2android { public void LockDatabase(bool allowQuickUnlock = true) { - if (_db.Loaded) + if (GetDb().Loaded) { if (QuickUnlockEnabled && allowQuickUnlock && _db.KpDatabase.MasterKey.ContainsType(typeof(KcpPassword)) &&