![cover](https://img-blog.csdnimg.cn/img_convert/5bbc102f2243430991aedee1be20b4f3.png)
解决安卓异步线程调用js无效问题
【代码】解决安卓异步线程调用js无效问题。
·
android.os.Handler mainHandler = new android.os.Handler(Looper.getMainLooper());
new Thread(() -> {
mainHandler.post( new Runnable() {
@Override
public void run() {
webView.loadUrl("javascript:alert()");
}
});
}).start();
更多推荐
所有评论(0)