java.lang.RuntimeException: Handler (com.***.behavior.BEvent$1) {421bca80} sending message to a Hand
java.lang.RuntimeException: Handler (com.***.behavior.BEvent$1) {421bca80} sending message to a Handler on a dead thread
它告诉你,你往死了的进程发了一个消息,然后没有办法执行。
我的代码错在这里:
sHandler.post(runnable);
handler虽然不为空,(静态的),但是它所在的进程已经死了(推出了程序),所以你post 就会出现上面的警告。我们看下post源码:
/**
* Causes the Runnable r to be added to the message queue.
* The runnable will be run on the thread to which this handler is
* attached.
*
* @param r The Runnable that will be executed.
*
* @return Returns true if the Runnable was successfully placed in to the
* message queue. Returns false on failure, usually because the
* looper processing the message queue is exiting.
*/
public final boolean post(Runnable r)
{
return sendMessageDelayed(getPostMessage(r), 0);
}
The runnable will be run on the thread to which this handler is
* attached.
所以 进程死了,就没有办法运行了。
总结:
1.代码没执行,记得看logcat的警告。
logcat的error,会直接crash.
warn 代码没执行,或者其他的问题,都会warn.
2.android程序退出了,但是进程没有杀死。
所有的静态变量,暂时还保存着。
java.lang.RuntimeException: Handler (com.***.behavior.BEvent$1) {421bca80} sending message to a Hand的更多相关文章
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()解决办法
代码改变世界 java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.pre ...
- Java EE之Struts2异常[No mapping found for dependency [type=java.lang.String, name='actionPackages'#java.lang.RuntimeException]【摘抄】
本博文摘自:http://www.blogjava.net/nkjava/archive/2009/03/29/262705.html 出现这个问题,可能是添加了struts2-codebehind包 ...
- Caused by: java.net.ConnectException: Connection refused/Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
1.使用sqoop技术将mysql的数据导入到Hive出现的错误如下所示: 第一次使用命令如下所示: [hadoop@slaver1 sqoop--cdh5.3.6]$ bin/sqoop impor ...
- 【Android】java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.
一.问题 Java调用JS事件出现 java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on th ...
- Toast.makeText 方法出错 java.lang.RuntimeException
接手以前同事留下的代码,今天突然出现了一个bug: java.lang.RuntimeException: Can't create handler inside thread that has no ...
- 错误:Camera录制视频(6.0错误),5.1正常,7.1正常 (java.lang.RuntimeException: start failed.at android.media.MediaRecorder.native_start(Native Method))
Process: com.example.mycamera2, PID: 24086 java.lang.RuntimeException: start failed. at android.medi ...
- hive跑mapreduce报java.lang.RuntimeException: Error in configuring object
写于2016.7月 最近项目需要在hbase上做统计分析,在本机上装了hive,结果跑小批量数据sum时报错: hive> select count(*) from page_view; Tot ...
- org.apache.hadoop.hbase.master.HMasterCommandLine: Master exiting java.lang.RuntimeException: HMaster Aborted
前一篇的问题解决了,是 hbase 下面lib 包的jar问题,之前写MR的时候加错了包,替换掉了原来的包后出现另一问题:@ubuntu:/home/hadoop/hbase-0.94.6-cdh4. ...
- 转载java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.spinner/com.example.spinner.MainActivity}: java.lang.NullPointerException
今天学习Android开发突然遇到了这个问题,查阅了很多资料,并且对集中原因进行了分析. 错误信息字符串:java.lang.RuntimeException: Unable to start act ...
随机推荐
- OMD开源监控软件
参考 Best Monitoring Solution - OMD (Nagios + Check_MK) 官网 mathias-kettner.com OMD labs.consol.de Conf ...
- Linux命令之创建文件夹3
1)mkdir fyr即可在当前目录下创建一个文件夹 2)在fyr文件夹下创建一个子目录 mkdir fyr/fyr1 注意:如果不存在父层目录直接创建对应父层目录下的子目录mkdir FYR/f ...
- Ubuntu18.04中使用中文输入法
如何在ubuntu18.04中设置使用中文输入法 ubuntu 在最新的版本中已经可以不用用户自己单独去下载中文输入法使用了,本次使用为 ubuntu18.04LTS版本(登陆是界面选择的是ubunt ...
- Python基础学习之字符串(2)
字符串常用方法 1.s.capitalize() 描述:返回字符串s的副本,并将首字符变为大写. 示例: >>> s='yesterday when I was Young!' &g ...
- 笨办法学Python(十九)
习题 19: 函数和变量 函数这个概念也许承载了太多的信息量,不过别担心.只要坚持做这些练习,对照上个练习中的检查点检查一遍这次的联系,你最终会明白这些内容的. 有一个你可能没有注意到的细节,我们现在 ...
- API:什么是API?API与interface的区别
我们都知道,API就是接口,那是什么鬼呢? 1.什么是API? api接口开发,其实和平时开发逻辑差不多:但是也有略微差异: 平时使用mvc开发网站的思路一般是都 由控制器 去 调用模型,模型返回数据 ...
- Spring是如何管理Bean
容器是什么?spring中是如何体现的?一直有疑惑,这两天看了一下Spring管理bean的Demo,对于Spring中的容器有了简单的认识. 我们知道,容器是一个空间的概念,一般理解为可盛放物体的地 ...
- Linux下进程信息的深入分析[转]
这里我们主要介绍进程的状态,进程的状态可以通过/proc/PID/status来查看,也可以通过/proc/PID/stat来查看. 如果说到工具大家用的最多的ps也可以看到进程的信息.这里我们通过/ ...
- elsevier期刊要求翻译
百度文库 http://wenku.baidu.com/view/e20a27e84afe04a1b071de4e.html 官网文档 http://www.elsevier.com/journals ...
- 等待唤醒机制,UDP通信和TCP通信
等待唤醒机制 通过等待唤醒机制使各个线程能有效的利用资源. 等待唤醒机制所涉及到的方法: wait() :等待,将正在执行的线程释放其执行资格 和 执行权,并存储到线程池中. notify():唤醒, ...