Simplified compose/share workaround

This commit is contained in:
M66B
2021-02-10 19:35:41 +01:00
parent ccd274fe9e
commit 38bfd63a9c
2 changed files with 11 additions and 18 deletions

View File

@@ -60,23 +60,19 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
Intent intent = getIntent();
if (intent != null && isShared(intent.getAction())) {
finishAffinity();
return;
if (!isShared(getIntent().getAction())) {
Intent parent = getParentActivityIntent();
if (parent != null)
if (shouldUpRecreateTask(parent))
TaskStackBuilder.create(this)
.addNextIntentWithParentStack(parent)
.startActivities();
else {
parent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(parent);
}
}
Intent parent = getParentActivityIntent();
if (parent != null)
if (shouldUpRecreateTask(parent))
TaskStackBuilder.create(this)
.addNextIntentWithParentStack(parent)
.startActivities();
else {
parent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(parent);
}
finishAndRemoveTask();
}
}
@@ -85,8 +81,6 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
Bundle args;
String action = intent.getAction();
if (isShared(action)) {
Helper.excludeFromRecents(this);
args = new Bundle();
args.putString("action", "new");
args.putLong("account", -1);