From 2829ed77ccd19f277e9234566eed304fbeeb3851 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Tue, 3 Feb 2015 16:00:56 -0500 Subject: [PATCH] CB-8411 Initialize plugins only after createViews() is called --- .../src/org/apache/cordova/CordovaActivity.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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))) {