diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 01eff1c1..830332e4 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -219,16 +219,18 @@ public class CordovaActivity extends Activity implements CordovaInterface { try { Class webViewClass = Class.forName(r); Constructor [] webViewConstructors = webViewClass.getConstructors(); - - + if(CordovaWebView.class.isAssignableFrom(webViewClass)) { - CordovaWebView webView = (CordovaWebView) webViewConstructors[0].newInstance(this); - return webView; - } - else - { - LOG.e(TAG, "The WebView Engine is NOT a proper WebView, defaulting to system WebView"); + for (Constructor constructor : webViewConstructors) { + try { + CordovaWebView webView = (CordovaWebView) constructor.newInstance(this); + return webView; + } catch (IllegalArgumentException e) { + LOG.d(TAG, "Illegal arguments; trying next constructor."); + } + } } + LOG.e(TAG, "The WebView Engine is NOT a proper WebView, defaulting to system WebView"); } catch (ClassNotFoundException e) { LOG.e(TAG, "The WebView Engine was not found, defaulting to system WebView"); } catch (InstantiationException e) {