summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorBen Murdoch <benm@android.com>2014-12-11 19:02:26 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-11 19:02:26 +0000
commit12504199716c0b906c88769c19fc1734858e7a41 (patch)
treef6541a4221d93ff516a18dd0e391ad31b400740a /src/com/android/browser
parent967541840b77fc7cc33e96c7a02d57808ab94035 (diff)
parentf1077df463b0792dc9285286071b64f64ddbb623 (diff)
downloadpackages_apps_Browser-12504199716c0b906c88769c19fc1734858e7a41.zip
packages_apps_Browser-12504199716c0b906c88769c19fc1734858e7a41.tar.gz
packages_apps_Browser-12504199716c0b906c88769c19fc1734858e7a41.tar.bz2
am f1077df4: am 5baac25e: Merge "Log an error when no activity is found to handle a URL."
* commit 'f1077df463b0792dc9285286071b64f64ddbb623': Log an error when no activity is found to handle a URL.
Diffstat (limited to 'src/com/android/browser')
-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;
}
}