Commit ea2b7bb9 authored by aruslan@chromium.org's avatar aruslan@chromium.org

IntentHelper fix for chooser activity

FLAG_ACTIVITY_NEW_TASK is added as the chooser activity starts
outside the main activity.


Review URL: https://chromiumcodereview.appspot.com/10823146

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149684 0039d316-1c4b-4281-b951-d872f2087c98
parent b274b211
...@@ -61,7 +61,10 @@ public abstract class IntentHelper { ...@@ -61,7 +61,10 @@ public abstract class IntentHelper {
send.putExtra(Intent.EXTRA_SUBJECT, subject); send.putExtra(Intent.EXTRA_SUBJECT, subject);
send.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body)); send.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));
try { try {
context.startActivity(Intent.createChooser(send, chooserTitle)); Intent chooser = Intent.createChooser(send, chooserTitle));
// we start this activity outside the main activity.
chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(chooser);
} catch (android.content.ActivityNotFoundException ex) { } catch (android.content.ActivityNotFoundException ex) {
// If no app handles it, do nothing. // If no app handles it, do nothing.
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment