首页 > 移动平台 > 详细

【Android】java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.

时间:2017-12-04 11:19:06      阅读:916      评论:0      收藏:0      [点我收藏+]

一、问题

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调用

}});

【Android】java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.

原文:http://www.cnblogs.com/defineconst/p/7975728.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!