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的更多相关文章

  1. 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 ...

  2. 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包 ...

  3. 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 ...

  4. 【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 ...

  5. Toast.makeText 方法出错 java.lang.RuntimeException

    接手以前同事留下的代码,今天突然出现了一个bug: java.lang.RuntimeException: Can't create handler inside thread that has no ...

  6. 错误: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 ...

  7. hive跑mapreduce报java.lang.RuntimeException: Error in configuring object

    写于2016.7月 最近项目需要在hbase上做统计分析,在本机上装了hive,结果跑小批量数据sum时报错: hive> select count(*) from page_view; Tot ...

  8. 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. ...

  9. 转载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 ...

随机推荐

  1. "ssllabs" website and "testssl" website

    "https://www.ssllabs.com" could scan your server and give results about the weakness of yo ...

  2. ASP.NET Core - VSCode安装和配置

    在深入了解ASP.NET Core之前先研究了下主要的两个开发工具(VS 2015和VS Code), VS 2015对Core的支持已经相当的完备,很多操作得到简化用起来很是方便.VS Code是微 ...

  3. Xapian简明教程(未完成)

    第一章 简介 1.1 简介 Xapian是一个开源的搜索引擎库,它可以让开发者自定义的开发一些高级的的索引和查找因素应用在他们的应用中. 通过阅读这篇文档,希望可以帮助你创建第一个你的索引数据库和了解 ...

  4. selenium使用谷歌浏览器自带手机模拟器运行H5网页

    背景:最开始用手机模拟H5页面跑自动化,发现经常因为app连接或者网络原因等一系列情况,导致M版(H5页面)用例跑不通,想通过浏览器自带的手机模拟器运行,保证稳定性 浏览器自带的模拟器如下图: 代码实 ...

  5. IBM带库加磁带操作

    1.查询要弹出磁带的信息 可查询media日志,冻结,可用等,详情可查 查看带库空闲槽位 vmcheckxxx -rt tld -rn 0(0为带库名) 磁带详细信息: bpmedialist -m ...

  6. How To Secure Nginx with Let's Encrypt on Ubuntu 14.04

    https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14 ...

  7. Real VNC软件

    RealVNC5.2.3+key http://yunpan.cn/cjchAkeIgEAPG (提取码:4092)

  8. ios中的三种弹框

    目前为止,已经知道3种IOS弹框: 1.系统弹框-底部弹框 UIActionSheet  (1)用法:处理用户非常危险的操作,比如注销系统等 (2)举例: UIActionSheet *sheet = ...

  9. git(将现有项目加入osChina)

    将现有项目加入osChina 在osChina中创建项目 注意不要初始化项目.(其实初始化也没有什么问题,可以直接clone到本地,再把项目添加进去就行了,后续操作一样的) 项目现在基本为空,得到项目 ...

  10. jQuery选择器与事件学习笔记

    层次选择器:  $("div li")获取div下的所有li元素(后代.子.子的子......)  $("div>li")获取div下的直接li子元素.  ...