Revert "avoid potential crash in Android 12 while reloading the Database, closes https://github.com/PhilippC/keepass2android/issues/1909"
This reverts commit 40146a42ce,
because the root problem is fixed.
This commit is contained in:
@@ -72,20 +72,7 @@ namespace keepass2android.view
|
|||||||
_textView = (TextView)ev.FindViewById(Resource.Id.entry_text);
|
_textView = (TextView)ev.FindViewById(Resource.Id.entry_text);
|
||||||
_textView.TextSize = PrefsUtil.GetListTextSize(groupActivity);
|
_textView.TextSize = PrefsUtil.GetListTextSize(groupActivity);
|
||||||
|
|
||||||
Database db;
|
Database db = App.Kp2a.FindDatabaseForElement(pw);
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ev.FindViewById(Resource.Id.entry_icon_bkg).Visibility = db.DrawableFactory.IsWhiteIconSet ? ViewStates.Visible : ViewStates.Gone;
|
ev.FindViewById(Resource.Id.entry_icon_bkg).Visibility = db.DrawableFactory.IsWhiteIconSet ? ViewStates.Visible : ViewStates.Gone;
|
||||||
|
|
||||||
|
|||||||
@@ -81,22 +81,8 @@ namespace keepass2android.view
|
|||||||
_pwGroup = pw;
|
_pwGroup = pw;
|
||||||
|
|
||||||
ImageView iv = (ImageView) gv.FindViewById(Resource.Id.icon);
|
ImageView iv = (ImageView) gv.FindViewById(Resource.Id.icon);
|
||||||
|
Database db = App.Kp2a.FindDatabaseForElement(pw);
|
||||||
Database db;
|
db.DrawableFactory.AssignDrawableTo(iv, _groupBaseActivity, db.KpDatabase, pw.IconId, pw.CustomIconUuid, true);
|
||||||
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);
|
|
||||||
gv.FindViewById(Resource.Id.icon).Visibility = ViewStates.Visible;
|
gv.FindViewById(Resource.Id.icon).Visibility = ViewStates.Visible;
|
||||||
gv.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;
|
gv.FindViewById(Resource.Id.check_mark).Visibility = ViewStates.Invisible;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user