fix potential crash (opening an activity without NewTask flag)

This commit is contained in:
Philipp Crocoll
2019-11-06 18:27:24 +01:00
parent e5b3cf3db6
commit 326f4282d7

View File

@@ -831,11 +831,14 @@ namespace keepass2android
ActivityManager.RunningAppProcessInfo appProcessInfo = new ActivityManager.RunningAppProcessInfo();
ActivityManager.GetMyMemoryState(appProcessInfo);
//at least on Samsung devices, we always need the helper activity
mustUseHelperActivity = (appProcessInfo.Importance != Importance.Foreground) || (Build.Manufacturer != "Google");
//mustUseHelperActivity = (appProcessInfo.Importance != Importance.Foreground) || (Build.Manufacturer != "Google");
mustUseHelperActivity = true;
}
if (mustUseHelperActivity)
{
StartActivity(typeof(SwitchImeActivity));
Intent switchImeIntent = new Intent(this, typeof(SwitchImeActivity));
switchImeIntent.SetFlags(ActivityFlags.NewTask);
StartActivity(switchImeIntent);
}
else
{