diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index b70370ca..19f05407 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -478,20 +478,24 @@ namespace keepass2android builder.SetPositiveButton(activity.GetString(Android.Resource.String.Yes), (dlgSender, dlgEvt) => { - CurrentDb.ReloadRequested = true; + CurrentDb.ReloadRequested = true; activity.SetResult(KeePass.ExitReloadDb); activity.Finish(); if (actionOnResult != null) + { actionOnResult(true); - + actionOnResult = null; + } }); builder.SetNegativeButton(activity.GetString(Android.Resource.String.No), (dlgSender, dlgEvt) => { if (actionOnResult != null) + { actionOnResult(false); + actionOnResult = null; + } }); - Dialog dialog = builder.Create(); diff --git a/src/keepass2android/views/PwEntryView.cs b/src/keepass2android/views/PwEntryView.cs index e4affed8..85fa44f8 100644 --- a/src/keepass2android/views/PwEntryView.cs +++ b/src/keepass2android/views/PwEntryView.cs @@ -72,20 +72,7 @@ namespace keepass2android.view _textView = (TextView)ev.FindViewById(Resource.Id.entry_text); _textView.TextSize = PrefsUtil.GetListTextSize(groupActivity); - Database db; - try - { - db = App.Kp2a.FindDatabaseForElement(pw); - } - catch (Exception e) - { - //for some reason, since Android 12 we get here when the database is reloaded (after making remote changes and selecting sync) - //we can just ignore this. - Console.WriteLine(e); - return; - - } - + Database db = App.Kp2a.FindDatabaseForElement(pw); ev.FindViewById(Resource.Id.entry_icon_bkg).Visibility = db.DrawableFactory.IsWhiteIconSet ? ViewStates.Visible : ViewStates.Gone; diff --git a/src/keepass2android/views/PwGroupView.cs b/src/keepass2android/views/PwGroupView.cs index dc7c4c4b..832c9f33 100644 --- a/src/keepass2android/views/PwGroupView.cs +++ b/src/keepass2android/views/PwGroupView.cs @@ -81,22 +81,8 @@ namespace keepass2android.view _pwGroup = pw; ImageView iv = (ImageView) gv.FindViewById(Resource.Id.icon); - - Database db; - try - { - db = App.Kp2a.FindDatabaseForElement(pw); - } - catch (Exception e) - { - //for some reason, since Android 12 we get here when the database is reloaded (after making remote changes and selecting sync) - //we can just ignore this. - Console.WriteLine(e); - return; - - } - - db.DrawableFactory.AssignDrawableTo(iv, _groupBaseActivity, db.KpDatabase, pw.IconId, pw.CustomIconUuid, true); + Database db = App.Kp2a.FindDatabaseForElement(pw); + db.DrawableFactory.AssignDrawableTo(iv, _groupBaseActivity, db.KpDatabase, pw.IconId, pw.CustomIconUuid, true); gv.FindViewById(Resource.Id.icon).Visibility = ViewStates.Visible; gv.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;