mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-8411 Initialize plugins only after createViews() is called
This commit is contained in:
parent
aed4859642
commit
20723896e1
@ -155,6 +155,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
protected void init() {
|
||||
appView = makeWebView();
|
||||
createViews();
|
||||
appView.init(this, pluginEntries, internalWhitelist, externalWhitelist, preferences);
|
||||
|
||||
// Wire the hardware volume controls to control media if desired.
|
||||
String volumePref = preferences.getString("DefaultVolumeStream", "");
|
||||
@ -222,7 +223,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
Class<?> webViewClass = Class.forName(webViewClassName);
|
||||
Constructor<?> constructor = webViewClass.getConstructor(Context.class);
|
||||
CordovaWebView ret = (CordovaWebView) constructor.newInstance((Context)this);
|
||||
ret.init(this, pluginEntries, internalWhitelist, externalWhitelist, preferences);
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to create webview. ", e);
|
||||
|
Loading…
Reference in New Issue
Block a user