diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 69a96f01..cb8f27d4 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -333,11 +333,6 @@ public class CordovaActivity extends Activity implements CordovaInterface { } appView = webView != null ? webView : makeWebView(); - if (appView.pluginManager == null) { - appView.init(this, webViewClient != null ? webViewClient : makeWebViewClient(appView), - webChromeClient != null ? webChromeClient : makeChromeClient(appView), - pluginEntries, internalWhitelist, externalWhitelist, preferences); - } // TODO: Have the views set this themselves. if (preferences.getBoolean("DisallowOverscroll", false)) { @@ -345,6 +340,13 @@ public class CordovaActivity extends Activity implements CordovaInterface { } createViews(); + // Init plugins only after creating views + if (appView.pluginManager == null) { + appView.init(this, webViewClient != null ? webViewClient : makeWebViewClient(appView), + webChromeClient != null ? webChromeClient : makeChromeClient(appView), + pluginEntries, internalWhitelist, externalWhitelist, preferences); + } + // Wire the hardware volume controls to control media if desired. String volumePref = preferences.getString("DefaultVolumeStream", ""); if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) {