diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index b10ed75a..f1378c4f 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -480,7 +480,7 @@ public class AndroidWebView extends WebView implements CordovaWebView { me.stopLoading(); LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!"); if (viewClient != null) { - viewClient.onReceivedError(me, -6, "The connection to the server was unsuccessful.", url); + viewClient.onReceivedError(-6, "The connection to the server was unsuccessful.", url); } } }; diff --git a/framework/src/org/apache/cordova/AndroidWebViewClient.java b/framework/src/org/apache/cordova/AndroidWebViewClient.java index 3d82fcaa..b4166ec8 100755 --- a/framework/src/org/apache/cordova/AndroidWebViewClient.java +++ b/framework/src/org/apache/cordova/AndroidWebViewClient.java @@ -59,7 +59,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie private static final String TAG = "CordovaWebViewClient"; private static final String CORDOVA_EXEC_URL_PREFIX = "http://cdv_exec/"; CordovaInterface cordova; - CordovaWebView appView; + AndroidWebView appView; private boolean doClearHistory = false; boolean isCurrentlyLoading; @@ -81,7 +81,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie * @param cordova * @param view */ - public AndroidWebViewClient(CordovaInterface cordova, CordovaWebView view) { + public AndroidWebViewClient(CordovaInterface cordova, AndroidWebView view) { this.cordova = cordova; this.appView = view; } @@ -91,7 +91,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie * * @param view */ - public void setWebView(CordovaWebView view) { + public void setWebView(AndroidWebView view) { this.appView = view; } @@ -483,14 +483,8 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie } @Override - public void onReceivedError(CordovaWebView me, int i, String string, - String url) { - // Only deal with this if we're dealing with a proper classic webview. - if(WebView.class.isInstance(me)) - { - this.onReceivedError(me, i, string, url); - } - + public void onReceivedError(int errorCode, String description, String url) { + this.onReceivedError(appView, errorCode, description, url); } } diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 0929947b..e3abda79 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -299,8 +299,6 @@ public class CordovaActivity extends Activity implements CordovaInterface { this.appView.setWebViewClient(webViewClient); this.appView.setWebChromeClient(webChromeClient); - webViewClient.setWebView(this.appView); - webChromeClient.setWebView(this.appView); this.appView.setLayoutParams(new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java index e914af17..671e2273 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java @@ -1,9 +1,5 @@ package org.apache.cordova; public interface CordovaWebViewClient { - - void setWebView(CordovaWebView appView); - - void onReceivedError(CordovaWebView me, int i, String string, String url); - + void onReceivedError(int errorCode, String description, String url); } diff --git a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java index dbdd85ef..2501c981 100644 --- a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java @@ -40,7 +40,7 @@ public class IceCreamCordovaWebViewClient extends AndroidWebViewClient implement super(cordova); } - public IceCreamCordovaWebViewClient(CordovaInterface cordova, CordovaWebView view) { + public IceCreamCordovaWebViewClient(CordovaInterface cordova, AndroidWebView view) { super(cordova, view); } @@ -97,10 +97,4 @@ public class IceCreamCordovaWebViewClient extends AndroidWebViewClient implement } return false; } - - @Override - public void onReceivedError(CordovaWebView me, int i, String string, - String url) { - super.onReceivedError(me, i, string, url); - } }