browser component
我有一个JavaScript方法,可以预览
alert()
然后调用一个Java方法,这个Java方法应该加载
浏览器组件
有了新的内容,在模拟器上一切都很顺利,但在安卓设备上只有
pop-up
这是我的Java代码
JavascriptContext ctx = new JavascriptContext(browser);
browser.setPage(html, null);//this html is a string and it worked fine
JSObject window = (JSObject) ctx.get("window");
window.
set("openNewAccountPage", (JSFunction) (JSObject self, final Object[] params) ->
{
browser.setPage(NewAccountCreator.CreationPage, null);//the CreationPage is a string as html
});
这是我的脚本,它应该调用Java方法
function openNewAccountPageJS()
{
alert('yes we in it ');
window.openNewAccountPage();
}
这个
yes we in it