summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/UrlHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser/UrlHandler.java')
-rw-r--r--src/com/android/browser/UrlHandler.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java
index 207ada6..084a479 100644
--- a/src/com/android/browser/UrlHandler.java
+++ b/src/com/android/browser/UrlHandler.java
@@ -150,14 +150,19 @@ public class UrlHandler {
intent = new Intent(Intent.ACTION_VIEW, Uri
.parse("market://search?q=pname:" + packagename));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
- mActivity.startActivity(intent);
- // before leaving BrowserActivity, close the empty child tab.
- // If a new tab is created through JavaScript open to load this
- // url, we would like to close it as we will load this url in a
- // different Activity.
- mController.closeEmptyTab();
- return true;
- } else {
+ try {
+ mActivity.startActivity(intent);
+ // before leaving BrowserActivity, close the empty child tab.
+ // If a new tab is created through JavaScript open to load this
+ // url, we would like to close it as we will load this url in a
+ // different Activity.
+ mController.closeEmptyTab();
+ return true;
+ } catch (ActivityNotFoundException e) {
+ Log.w("Browser", "No activity found to handle " + url);
+ return false;
+ }
+ } else {
return false;
}
}