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. python模块详解 YAML和configparser

    YAML模块 主要用来做配置文件用的. yaml格式: 详细参考官方文档:PyYAML configparser模块 同样是用于生成和修改配置文件用的.格式和mysql一样. 生成配置文件 impor ...

  2. 获取文件绝对路径:__FILE__与$_SERVER[SCRIPT_FILENAME'']的区别

    1.获取路径 (1)__FILE__ 获取某文件在本地目录中的绝对路径,(也就是说,哪个文件执行这行代码,它就获取哪个文件的绝对路径) (2)$__SERVER['SCRIPT_FILENAME'] ...

  3. word禁止自动编号

    在回车.换行时使用 shift + enter

  4. CRM WebClient UI里的文件是如何上传到Netweaver后台的

    使用Chrome开发者工具调试CRM WebClient UI里附件上传的功能: 从本地选择一个文件,断点触发: 前端取得用户选中上传的文件名: Jerry.txt 点Attach按钮后,触发ABAP ...

  5. eclipse的一些快捷键

    ctrl + 1快速修复 ctrl + d 快速删除 ctrl + F11快速运行 ctrl + m 放大工作区 atl + /注释 ...

  6. 10分钟了解 代理模式与java中的动态代理

    前言    代理模式又分为静态代理与动态代理,其中动态代理是Java各大框架中运用的最为广泛的一种模式之一,下面就用简单的例子来说明静态代理与动态代理. 场景    李雷是一个唱片公司的大老板,很忙, ...

  7. 第9章 初识HAL固件库

    本章参考资料:<STM32F76xxx参考手册>.<STM32F7xx规格书>.<Cortex-M3权威指南>, STM32 HAL库帮助文档:<STM32F ...

  8. PHP调试小错误汇总

    1.中文显示乱码 解决:加上header('Content-type:text'); 2.Unable to find the wrapper "https 解决:到php.ini中把ext ...

  9. 3.初识Cron表达式

    Cron: 计划任务,是任务在约定的时间执行已经计划好的工作,这是表面的意思.在Linux中,我们经常用到 cron 服务器来完成这项工作.cron服务器可以根据配置文件约定的时间来执行特定的作务. ...

  10. 【Java】数组知识回顾

    package another; import java.util.Arrays; import java.util.List; /** * 数组知识回顾 * @author ChristineBas ...