launch some intents as new task

This commit is contained in:
Philipp Schaefer 2015-01-13 12:33:24 +01:00
parent 249f78859c
commit c551c41609
2 changed files with 6 additions and 2 deletions

View File

@ -237,6 +237,8 @@ public class IITC_WebViewClient extends WebViewClient {
} else { } else {
Log.d("no ingress intel link, start external app to load url: " + url); Log.d("no ingress intel link, start external app to load url: " + url);
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
// make new activity independent from iitcm
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mIitc.startActivity(intent); mIitc.startActivity(intent);
} }
return true; return true;

View File

@ -107,7 +107,8 @@ public class IntentGenerator {
public ArrayList<Intent> getBrowserIntents(final String title, final String url) { public ArrayList<Intent> getBrowserIntents(final String title, final String url) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)) final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url))
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); .addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return resolveTargets(intent); return resolveTargets(intent);
} }
@ -115,7 +116,8 @@ public class IntentGenerator {
public ArrayList<Intent> getGeoIntents(final String title, final String mLl, final int mZoom) { public ArrayList<Intent> getGeoIntents(final String title, final String mLl, final int mZoom) {
final Intent intent = new Intent(android.content.Intent.ACTION_VIEW, final Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse(String.format("geo:%s?z=%d", mLl, mZoom))) Uri.parse(String.format("geo:%s?z=%d", mLl, mZoom)))
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); .addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final ArrayList<Intent> targets = resolveTargets(intent); final ArrayList<Intent> targets = resolveTargets(intent);