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:
parent
dd960c39a4
commit
8be1b3394c
1 changed files with 118 additions and 110 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue