cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject android commit: CB-7265 Fix crash when navigating to custom protocol (introduced in 3.5.1)
Date Thu, 07 Aug 2014 14:00:52 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master d6eb723b7 -> 73219bf2d


CB-7265 Fix crash when navigating to custom protocol (introduced in 3.5.1)

Conflicts:
	framework/src/org/apache/cordova/CordovaUriHelper.java

Github: close #111


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/73219bf2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/73219bf2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/73219bf2

Branch: refs/heads/master
Commit: 73219bf2d22a7057f19b6dd9cd8fd24632316d90
Parents: d6eb723
Author: Martin Bektchiev <martin.bektchiev@telerik.com>
Authored: Wed Aug 6 15:24:51 2014 +0300
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Aug 7 09:58:40 2014 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/CordovaUriHelper.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/73219bf2/framework/src/org/apache/cordova/CordovaUriHelper.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaUriHelper.java b/framework/src/org/apache/cordova/CordovaUriHelper.java
index dcbaeb5..bb78592 100644
--- a/framework/src/org/apache/cordova/CordovaUriHelper.java
+++ b/framework/src/org/apache/cordova/CordovaUriHelper.java
@@ -19,8 +19,10 @@
 
 package org.apache.cordova;
 
+import android.annotation.TargetApi;
 import android.content.Intent;
 import android.net.Uri;
+import android.os.Build;
 import android.webkit.WebView;
 
 class CordovaUriHelper {
@@ -44,6 +46,7 @@ class CordovaUriHelper {
      * @param url           The url to be loaded.
      * @return              true to override, false for default behavior
      */
+    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
     boolean shouldOverrideUrlLoading(WebView view, String url) {
         // The WebView should support http and https when going on the Internet
         if(url.startsWith("http:") || url.startsWith("https:"))
@@ -71,7 +74,9 @@ class CordovaUriHelper {
                 intent.setData(Uri.parse(url));
                 intent.addCategory(Intent.CATEGORY_BROWSABLE);
                 intent.setComponent(null);
-                intent.setSelector(null);
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
{
+                    intent.setSelector(null);
+                }
                 this.cordova.getActivity().startActivity(intent);
             } catch (android.content.ActivityNotFoundException e) {
                 LOG.e(TAG, "Error loading url " + url, e);


Mime
View raw message