Finished affinity

This commit is contained in:
M66B 2023-04-29 12:36:14 +02:00
parent e330f73eb3
commit 55b29bced6
1 changed files with 12 additions and 2 deletions

View File

@ -76,6 +76,7 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
Intent intent = getIntent();
String action = intent.getAction();
boolean shared = isShared(action);
boolean widget = (action != null && action.startsWith("widget:"));
String[] tos = intent.getStringArrayExtra(Intent.EXTRA_EMAIL);
@ -87,7 +88,7 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)
.putExtra("tab", "backup");
startActivity(setup);
} else if (!isShared(action) && !widget) {
} else if (!shared && !widget) {
Intent parent = getParentActivityIntent();
if (parent != null)
if (shouldUpRecreateTask(parent))
@ -103,7 +104,16 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().remove("last_composing").apply();
finishAndRemoveTask();
try {
if (shared || widget) {
Helper.excludeFromRecents(this);
finishAffinity();
} else
finishAndRemoveTask();
} catch (Throwable ex) {
Log.e(ex);
finish();
}
}
}