mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +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() {
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user