Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

只能js调用java代码而java设置不了js吗 比如java发送消息给webview #31

Open
tghjnjvg opened this issue Apr 19, 2020 · 1 comment

Comments

@tghjnjvg
Copy link

只能js调用java代码而java设置不了js吗 比如java发送消息给webview

@pengwei1024
Copy link
Owner

只能js调用java代码而java设置不了js吗 比如java发送消息给webview

可以啊,java调用 webview 方法只需要注入js 就好,loadUrl 或者 evaluateJavascript 都是可以的,比如你想执行网页的刷新,可以使用

webview.evaluateJavascript("location.reload()", null)

也就是说只要注入js的执行路径就好,自定义的方法也是这么执行的哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants