summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Murdoch <benm@android.com>2014-12-11 18:55:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-11 18:55:53 +0000
commitf1077df463b0792dc9285286071b64f64ddbb623 (patch)
tree740da990857986077e7243ef1b4bd1478f58174b
parentf2c4b5bb1863ff1e001f36e3d263f28dc52f5a53 (diff)
parent5baac25e0601e9894ee6fc690a9f6d0f534af4a2 (diff)
downloadBrowser-f1077df463b0792dc9285286071b64f64ddbb623.tar.gz
am 5baac25e: Merge "Log an error when no activity is found to handle a URL."
* commit '5baac25e0601e9894ee6fc690a9f6d0f534af4a2': Log an error when no activity is found to handle a URL.
-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 e21e3e87..edafebd1 100644
--- a/src/com/android/browser/UrlHandler.java
+++ b/src/com/android/browser/UrlHandler.java
@@ -144,14 +144,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;
}
}