Androidjava.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread '

Posted 再出发

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Androidjava.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread '相关的知识,希望对你有一定的参考价值。

一、问题

Java调用JS事件出现

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) {3474c308} called on Looper (JavaBridge, tid 514) {2886ca4f}, FYI main Looper is Looper (main, tid 1) {3474c308})

二、解决方案

https://stackoverflow.com/questions/22607657/webview-methods-on-same-thread-error

http://blog.csdn.net/violetjack0808/article/details/52936157

public Handler handler = new Handler();

handler.post(new Runnable() {

public void run() {

//JS调用

}});

以上是关于Androidjava.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread '的主要内容,如果未能解决你的问题,请参考以下文章