new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.zxing_url)));
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);
}
};
switch (item.getItemId()) {
case SHARE_ID: {
Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(this, ShareActivity.class.getName());
startActivity(intent);
break;
}
case SETTINGS_ID: {
Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(this, PreferencesActivity.class.getName());
startActivity(intent);
break;
}
case HELP_ID: {
Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(this, HelpActivity.class.getName());
startActivity(intent);
break;
// Hand back whatever action they requested - this can be changed to Intents.Scan.ACTION when
// the deprecated intent is retired.
Intent intent = new Intent(getIntent().getAction());
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Intents.Scan.RESULT, rawResult.toString());
intent.putExtra(Intents.Scan.RESULT_FORMAT, rawResult.getBarcodeFormat().toString());
Message message = Message.obtain(handler, R.id.return_scan_result);
if (currentVersion > lastVersion) {
prefs.edit().putInt(PreferencesActivity.KEY_HELP_VERSION_SHOWN, currentVersion).commit();
Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(this, HelpActivity.class.getName());
startActivity(intent);
return true;
break;
case R.id.launch_product_query:
String url = (String) message.obj;
- activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ activity.startActivity(intent);
break;
}
}
private final DialogInterface.OnClickListener groupsListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialogInterface, int i) {
- HelpActivity.this.startActivity(new Intent(Intent.ACTION_VIEW, BUGGY_URI));
+ Intent intent = new Intent(Intent.ACTION_VIEW, BUGGY_URI);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ HelpActivity.this.startActivity(intent);
}
};
String readBookURI = "http://books.google." +
LocaleManager.getBookSearchCountryTLD() +
"/books?id=" + volumeId + "&pg=" + pageId + "&vq=" + query;
- activity.startActivity(new Intent(Intent.ACTION_VIEW,
- Uri.parse(readBookURI)));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(readBookURI));
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ activity.startActivity(intent);
}
}
}
} else if (i == dialogItems.length - 2) {
String history = buildHistory();
Intent intent = new Intent(Intent.ACTION_SEND, Uri.parse("mailto:"));
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Intent.EXTRA_SUBJECT, res.getString(R.string.history_email_title));
intent.putExtra(Intent.EXTRA_TEXT, history);
intent.setType("text/plain");
void launchIntent(Intent intent) {
if (intent != null) {
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
try {
activity.startActivity(intent);
} catch (ActivityNotFoundException e) {
if (position >= 0 && position < labelsPackages.size()) {
String url = "market://search?q=pname:" + labelsPackages.get(position)[1];
Intent intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Browser.BookmarkColumns.URL, url);
setResult(RESULT_OK, intent);
} else {
protected void onListItemClick(ListView l, View view, int position, long id) {
if (cursor.moveToPosition(position)) {
Intent intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN));
intent.putExtra(Browser.BookmarkColumns.URL, cursor.getString(URL_COLUMN));
setResult(RESULT_OK, intent);
private final Button.OnClickListener contactListener = new Button.OnClickListener() {
public void onClick(View v) {
- startActivityForResult(new Intent(Intent.ACTION_PICK, Contacts.People.CONTENT_URI),
- PICK_CONTACT);
+ Intent intent = new Intent(Intent.ACTION_PICK, Contacts.People.CONTENT_URI);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ startActivityForResult(intent, PICK_CONTACT);
}
};
private final Button.OnClickListener bookmarkListener = new Button.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(ShareActivity.this, BookmarkPickerActivity.class.getName());
startActivityForResult(intent, PICK_BOOKMARK);
}
private final Button.OnClickListener appListener = new Button.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setClassName(ShareActivity.this, AppPickerActivity.class.getName());
startActivityForResult(intent, PICK_APP);
}
// Should always be true, because we grey out the clipboard button in onResume() if it's empty
if (clipboard.hasText()) {
Intent intent = new Intent(Intents.Encode.ACTION);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Intents.Encode.TYPE, Contents.Type.TEXT);
intent.putExtra(Intents.Encode.DATA, clipboard.getText());
intent.putExtra(Intents.Encode.FORMAT, Contents.Format.QR_CODE);
private void showTextAsBarcode(String text) {
Intent intent = new Intent(Intents.Encode.ACTION);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Intents.Encode.TYPE, Contents.Type.TEXT);
intent.putExtra(Intents.Encode.DATA, text);
intent.putExtra(Intents.Encode.FORMAT, Contents.Format.QR_CODE);
}
Intent intent = new Intent(Intents.Encode.ACTION);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra(Intents.Encode.TYPE, Contents.Type.CONTACT);
intent.putExtra(Intents.Encode.DATA, bundle);
intent.putExtra(Intents.Encode.FORMAT, Contents.Format.QR_CODE);