mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Finish affinity
This commit is contained in:
@@ -60,6 +60,12 @@ 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;
|
||||
}
|
||||
|
||||
Intent parent = getParentActivityIntent();
|
||||
if (parent != null)
|
||||
if (shouldUpRecreateTask(parent))
|
||||
@@ -78,11 +84,7 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||
private void handle(Intent intent) {
|
||||
Bundle args;
|
||||
String action = intent.getAction();
|
||||
if (Intent.ACTION_VIEW.equals(action) ||
|
||||
Intent.ACTION_SENDTO.equals(action) ||
|
||||
Intent.ACTION_SEND.equals(action) ||
|
||||
Intent.ACTION_SEND_MULTIPLE.equals(action)) {
|
||||
|
||||
if (isShared(action)) {
|
||||
args = new Bundle();
|
||||
args.putString("action", "new");
|
||||
args.putLong("account", -1);
|
||||
@@ -199,4 +201,11 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("compose");
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private static boolean isShared(String action) {
|
||||
return (Intent.ACTION_VIEW.equals(action) ||
|
||||
Intent.ACTION_SENDTO.equals(action) ||
|
||||
Intent.ACTION_SEND.equals(action) ||
|
||||
Intent.ACTION_SEND_MULTIPLE.equals(action));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user