Android-Throwable: A WebView method was called on thread 'JavaBridge'.

错误详情:

01-30 03:36:52.441 12000-12048/cn.h5 D/@@@: e.ttt:java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {18b9c7c8} called on Looper (JavaBridge, tid 481) {789820c}, FYI main Looper is Looper (main, tid 1) {18b9c7c8})

 

Android-Throwable: A WebView method was called on thread 'JavaBridge'.

 

当出现以上错误后,处于阻塞状态,无任何效果,出现此错误的原因是:

webView.loadUrl("javascript:show(" + json + ")");

 

解决方法:

runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                       
                        webView.loadUrl("javascript:show(" + json + ")");
                    }
                });

 

上一篇:mySql一个字段的值模糊匹配多表多列的查询


下一篇:mysql常用操作