Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 314419cc authored by Adam Powell's avatar Adam Powell
Browse files

Update ShareActionProvider to clear the sharing activity when the task

is reset.

As per platform guidelines, when launching a sharing activity the Intent
flag FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET should be used.

Change-Id: I30bd3d20eb75aee7943b681dc2d9c7f44a04e919
parent 629c6765
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -547,6 +547,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
                        position = mAdapter.getShowDefaultActivity() ? position : position + 1;
                        Intent launchIntent = mAdapter.getDataModel().chooseActivity(position);
                        if (launchIntent != null) {
                            launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                            mContext.startActivity(launchIntent);
                        }
                    }
@@ -564,6 +565,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod
                final int index = mAdapter.getDataModel().getActivityIndex(defaultActivity);
                Intent launchIntent = mAdapter.getDataModel().chooseActivity(index);
                if (launchIntent != null) {
                    launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                    mContext.startActivity(launchIntent);
                }
            } else if (view == mExpandActivityOverflowButton) {
+1 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ public class ShareActionProvider extends ActionProvider {
            final int itemId = item.getItemId();
            Intent launchIntent = dataModel.chooseActivity(itemId);
            if (launchIntent != null) {
                launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                mContext.startActivity(launchIntent);
            }
            return true;