Use correct client object in recent versions of android again

This commit is contained in:
Ian Clelland 2014-05-02 10:29:53 -04:00
parent 955da2e360
commit e595c313a1

View File

@ -219,13 +219,13 @@ public class AndroidWebView extends WebView implements CordovaWebView {
* Create a default WebViewClient object for this webview. This can be overridden by the * Create a default WebViewClient object for this webview. This can be overridden by the
* main application's CordovaActivity subclass. * main application's CordovaActivity subclass.
* *
* By default, it creates an AndroidWebViewClient, but we provide special case handling for * There are two possible client objects that can be returned:
* IceCreamSandwich. * AndroidWebViewClient for android < 3.0
* IceCreamCordovaWebViewClient for Android >= 3.0 (Supports shouldInterceptRequest)
*/ */
@Override @Override
public CordovaWebViewClient makeWebViewClient() { public CordovaWebViewClient makeWebViewClient() {
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB || if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.JELLY_BEAN_MR1)
{ {
return (CordovaWebViewClient) new AndroidWebViewClient(this.cordova, this); return (CordovaWebViewClient) new AndroidWebViewClient(this.cordova, this);
} }