【Android】java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.
2017-12-04 10:03
555 查看
一、问题
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调用
}});
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调用
}});
相关文章推荐
- java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.
- Android Webview 加载一个页面时,报错 java.lang.Throwable: EventHub.removeMessages(int what = 105) is not suppo
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class
- android开发 WebViewjava.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebVie
- Android 使用Webview时,有时抛 java.lang.Throwable: EventHub.removeMessages(int what = 107) warning
- Android 自定义View java.lang.RuntimeException: Unable to start activity ComponentInfo
- ERROR/AndroidRuntime(716): java.lang.SecurityException: Binder invocation to an incorrect interface
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.L
- java.lang.ClassCastException: android.widget.HeaderViewListAdapter cannot be cast to com.android.mms
- Android 问题异常 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo
- java.lang.Class Cast Exception: android.widget.HeaderViewListAdapter
- ERROR/AndroidRuntime: Caused by: java.lang.ClassCastException: android.widget.button
- java.lang.ClassCastException: android.widget.ImageView
- java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ProgressBar$SavedState
- Caused by: java.lang.ClassCastException: android.widget.TextView修复
- Android开发中java.lang.RuntimeException:错误的集中原因及解决办法
- java.lang.ClassCastException: android.widget.ImageView
- Android ListView分页时出现java.lang.ClassCastException: android.widget.HeaderViewListAdapter异常
- android中调用findViewById时出现:java.lang.NullPointerException