diff options
author | Ben Murdoch <benm@android.com> | 2014-12-11 19:02:26 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-11 19:02:26 +0000 |
commit | 12504199716c0b906c88769c19fc1734858e7a41 (patch) | |
tree | f6541a4221d93ff516a18dd0e391ad31b400740a /src/com/android | |
parent | 967541840b77fc7cc33e96c7a02d57808ab94035 (diff) | |
parent | f1077df463b0792dc9285286071b64f64ddbb623 (diff) | |
download | packages_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')
-rw-r--r-- | src/com/android/browser/UrlHandler.java | 21 |
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; } } |