1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

Added share into

This commit is contained in:
M66B 2020-07-03 18:24:16 +02:00
parent dd960c39a4
commit 8be1b3394c

View file

@ -44,9 +44,36 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
getSupportFragmentManager().addOnBackStackChangedListener(this);
if (getSupportFragmentManager().getFragments().size() == 0) {
handle(getIntent());
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
handle(intent);
}
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
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();
}
}
private void handle(Intent intent) {
Bundle args;
Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action) ||
Intent.ACTION_SENDTO.equals(action) ||
@ -155,23 +182,4 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("compose");
fragmentTransaction.commit();
}
}
@Override
public void onBackStackChanged() {
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
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();
}
}
}