Merge "Fix crash in STK." into ics-mr1
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 3289918..1007a4a 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -695,13 +695,10 @@
if (settings == null) {
return;
}
- // Set browser launch mode
- Intent intent = new Intent();
- intent.setClassName("com.android.browser",
- "com.android.browser.BrowserActivity");
- // to launch home page, make sure that data Uri is null.
- Uri data = null;
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+
+ Uri data;
if (settings.url != null) {
CatLog.d(this, "settings.url = " + settings.url);
if ((settings.url.startsWith("http://") || (settings.url.startsWith("https://")))) {
@@ -722,14 +719,13 @@
data = Uri.parse("http://google.com/");
}
intent.setData(data);
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
switch (settings.mode) {
case USE_EXISTING_BROWSER:
- intent.setAction(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
break;
case LAUNCH_NEW_BROWSER:
- intent.setAction(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
break;
case LAUNCH_IF_NOT_ALREADY_LAUNCHED: