CB-8411 Initialize plugins only after createViews() is called

This commit is contained in:
Andrew Grieve
2015-02-03 16:00:56 -05:00
parent f3885692d9
commit 2829ed77cc

View File

@@ -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))) {