I'm having real trouble to access appView
from the latest Cordova version for Android (5.0.0).
For example, say I want to add a Javascript interface to my app. Before this version, I used to write this line of code:
super.appView.addJavascriptInterface(new WebAppInterface(this), "jsInterface");
And then the WebAppInterface
:
public class WebAppInterface { ... }
Now, it just does not work. Has Cordova changed something recently? I seriously have no idea of what to do.
In both cases (previous version and new one), my main activity has this structure:
public class CordovaApp extends CordovaActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
loadUrl(Config.getStartUrl());
...
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…