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

This commit is contained in:
Andrew Grieve 2015-02-03 16:03:15 -05:00
parent aed4859642
commit 20723896e1

View File

@ -155,6 +155,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
protected void init() { protected void init() {
appView = makeWebView(); appView = makeWebView();
createViews(); createViews();
appView.init(this, pluginEntries, internalWhitelist, externalWhitelist, preferences);
// Wire the hardware volume controls to control media if desired. // Wire the hardware volume controls to control media if desired.
String volumePref = preferences.getString("DefaultVolumeStream", ""); String volumePref = preferences.getString("DefaultVolumeStream", "");
@ -222,7 +223,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
Class<?> webViewClass = Class.forName(webViewClassName); Class<?> webViewClass = Class.forName(webViewClassName);
Constructor<?> constructor = webViewClass.getConstructor(Context.class); Constructor<?> constructor = webViewClass.getConstructor(Context.class);
CordovaWebView ret = (CordovaWebView) constructor.newInstance((Context)this); CordovaWebView ret = (CordovaWebView) constructor.newInstance((Context)this);
ret.init(this, pluginEntries, internalWhitelist, externalWhitelist, preferences);
return ret; return ret;
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("Failed to create webview. ", e); throw new RuntimeException("Failed to create webview. ", e);