java.lang.Throwable: Warning: A WebView methods must be called on the same thread.
来源:互联网 发布:制作pdf的软件 编辑:程序博客网 时间:2024/04/29 23:48
java.lang.Throwable: Warning: A WebView methods must be called on the same thread.
出现的问题如下所示:
04-28 10:35:45.464: W/webview(2495): java.lang.Throwable: Warning: A WebView method was called on thread 'Timer-0'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
其实在android4.4以下版本也不会出什么问题,以前我也这么写过,但是 Android 4.1,API 17,也就是JELLY_BEAN 开始,android就针对webview中执行js代码和原生代码之间交互做了一些改动
把js调用的方法放在同一个handler.post线程执行就没有问题了
webView.loadUrl("..");
写成
webView.post(new Runnable() {
@Override
public void run() {
webView.loadUrl("javascript: alert(" + data +")");
}
});
0 0
- java.lang.Throwable: Warning: A WebView methods must be called on the same thread.
- 异常A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same
- A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same t
- [Android]All WebView methods must be called on the same thread.线程安全
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- Cause by:All WebView methods must be called on the same thread[问题已解决]
- 安卓调用JS All WebView methods must be called on the same thread
- java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.
- Android异常解决--A WebView method was called on thread 'JavaBridge'. All WebView methods must be called
- webview在红米3上面打开显示错误A WebView method was called on thread 'Thread-9191'. All WebView methods must be
- android开发 WebViewjava.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebVie
- WebView methods on same thread error
- [Android]WebView method must on same thread
- QMutex“A mutex must be unlocked in the same thread that locked it”解决
- 解决java.lang.IllegalStateException: Calling View methods on another thread than the UI thread
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query 问题的解决
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the qury 问题的解决
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query
- 用mysql source命令可以导入比较大的文件
- poj 动态规划DP - 2533 Longest Ordered Subsequence
- (四)Linux网络编程--4. 完整的读写函数
- android Timer TimerTask Handler 设备震动
- undefined format 未定界形式, 不定长形式
- java.lang.Throwable: Warning: A WebView methods must be called on the same thread.
- udig+postgresql
- unix网络编程卷一: 第八章:简单UDP客户端服务器通信(一)
- Ibaits操作二进制数据的一些小技巧
- mkdir命令
- Linux进程间通信——命名管道
- POJ_2446_Chessboard(二分图匹配)
- 使用spring @Scheduled注解执行定时任务
- MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException