Android Exception 13(Can't create handler inside thread that has not called Looper.prepare())
10-12 17:02:55.500: E/AndroidRuntime(28343): FATAL EXCEPTION: Timer-2
10-12 17:02:55.500: E/AndroidRuntime(28343): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
10-12 17:02:55.500: E/AndroidRuntime(28343): at android.os.Handler.<init>(Handler.java:197)
10-12 17:02:55.500: E/AndroidRuntime(28343): at android.os.Handler.<init>(Handler.java:111)
10-12 17:02:55.500: E/AndroidRuntime(28343): at android.widget.Toast$TN.<init>(Toast.java:339)
10-12 17:02:55.500: E/AndroidRuntime(28343): at android.widget.Toast.<init>(Toast.java:98)
10-12 17:02:55.500: E/AndroidRuntime(28343): at android.widget.Toast.makeText(Toast.java:245)
10-12 17:02:55.500: E/AndroidRuntime(28343): at com.tongyan.activity.gps.SectionIndexAct$5.handleMessage(SectionIndexAct.java:503)
10-12 17:02:55.500: E/AndroidRuntime(28343): at com.tongyan.activity.gps.SectionIndexAct$9.run(SectionIndexAct.java:426)
10-12 17:02:55.500: E/AndroidRuntime(28343): at java.util.Timer$TimerImpl.run(Timer.java:284)
10-12 17:02:56.270: E/WindowManager(28343): Activity com.tongyan.activity.gps.SectionIndexAct has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{41525f48 V.E..... R......D 0,0-67,67} that was originally added here
10-12 17:02:56.270: E/WindowManager(28343): android.view.WindowLeaked: Activity com.tongyan.activity.gps.SectionIndexAct has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{41525f48 V.E..... R......D 0,0-67,67} that was originally added here
10-12 17:02:56.270: E/WindowManager(28343): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:382)
10-12 17:02:56.270: E/WindowManager(28343): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:219)
10-12 17:02:56.270: E/WindowManager(28343): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
10-12 17:02:56.270: E/WindowManager(28343): at android.app.Dialog.show(Dialog.java:281)
10-12 17:02:56.270: E/WindowManager(28343): at com.tongyan.activity.gps.SectionIndexAct.collectPoint(SectionIndexAct.java:392)
10-12 17:02:56.270: E/WindowManager(28343): at com.tongyan.activity.gps.SectionIndexAct$GpsSectionMenuListAdapter$1.onClick(SectionIndexAct.java:577)
10-12 17:02:56.270: E/WindowManager(28343): at android.view.View.performClick(View.java:4219)
10-12 17:02:56.270: E/WindowManager(28343): at android.view.View$PerformClick.run(View.java:17422)
10-12 17:02:56.270: E/WindowManager(28343): at android.os.Handler.handleCallback(Handler.java:725)
10-12 17:02:56.270: E/WindowManager(28343): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 17:02:56.270: E/WindowManager(28343): at android.os.Looper.loop(Looper.java:137)
10-12 17:02:56.270: E/WindowManager(28343): at android.app.ActivityThread.main(ActivityThread.java:5119)
10-12 17:02:56.270: E/WindowManager(28343): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 17:02:56.270: E/WindowManager(28343): at java.lang.reflect.Method.invoke(Method.java:511)
10-12 17:02:56.270: E/WindowManager(28343): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:834)
10-12 17:02:56.270: E/WindowManager(28343): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
10-12 17:02:56.270: E/WindowManager(28343): at dalvik.system.NativeStart.main(Native Method)
原因是你在子线程里去handleMessage了,至于具体分析,还请自行google
Android Exception 13(Can't create handler inside thread that has not called Looper.prepare())的更多相关文章
- Android进阶(八)Can't create handler inside thread that has not called Looper.prepare()
Error:Can't create handler inside thread that has not called Looper.prepare() 原代码: //利用Handler消息传递机制 ...
- Android 错误提示: Can't create handler inside thread that has not called Looper.prepare()
Can't create handler inside thread that has not called Looper.prepare() 将 Handler handler = new Hand ...
- Android 线程更新UI报错 : Can't create handler inside thread that has not called Looper.prepare()
MainActivity中有一个按钮,绑定了save方法 public void save(View view) { String title = titleText.getText().toStri ...
- Android handler 报错处理Can't create handler inside thread that has not called Looper.prepare()
问题: 写了一个sdk给其他人用,提供一个回调函数,函数使用了handler处理消息 // handler监听网络请求,完成后操作回调函数 final Handler trigerGfHandler ...
- Android进阶(十六)子线程调用Toast报Can't create handler inside thread that has not called Looper.prepare() 错误
原子线程调用Toast报Can't create handler inside thread that has not called Looper.prepare() 错误 今天用子线程调Toast报 ...
- 在子线程中new Handler报错--Can't create handler inside thread that has not called Looper.prepare()
在子线程中new一个Handler为什么会报以下错误? java.lang.RuntimeException: Can't create handler inside thread that has ...
- 关于子线程使用Toast报错Can't create handler inside thread that has not called Looper.prepare()的解决办法
形同如下代码,在Thread中调用Toast显示错误信息: new Thread(new Runnable(){ @Override public void run() { try{ weatherD ...
- Can’t create handler inside thread that has not called Looper.prepare()
1)在Android 2.3以前,为防止ANR(Application Not Responding),Google是不赞成将网络连接等一系列耗时操作直接放到应用主线程进行的,推荐将这类操作放在子线程 ...
- Android-java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
章出自:luchg技术交流 http://www.luchg.com 版权所有.本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源,谢谢. Android-java.lang.Runti ...
随机推荐
- Trie树【UVA11362】Phone List
Description 给定\(n\)个长度不超过\(10\)的数字串,判断是否有两个字符串\(A\)和\(B\),满足\(A\)是\(B\)的前缀,若有,输出NO,若没有,输出YES. 一道\(Tr ...
- 洛谷——P1068 分数线划定
P1068 分数线划定 题目描述 世博会志愿者的选拔工作正在 A 市如火如荼的进行.为了选拔最合适的人才,A 市对 所有报名的选手进行了笔试,笔试分数达到面试分数线的选手方可进入面试.面试分数线根 据 ...
- 图灵杯 E 简单的RMQ(UVA 11235)(RMQ)
E: 简单的RMQ 时间限制: 2 Sec 内存限制: 64 MB提交: 934 解决: 165[提交][状态][讨论版] 题目描述 给定一个数组,其中的元素满足非递减顺序.任意给定一个区间[i, ...
- RabbitMQ (十五) 镜像集群 + HAProxy1.7.8 负载均衡
RabbitMQ 默认的集群模式,也就是普通模式,最大的问题就在于存储队列完整数据的节点一旦宕机, 如果是非持久化队列,则消息丢失;如果是持久化队列+持久化消息,则必须等该节点恢复. 所以后来 Rab ...
- Python开发基础-Day21多态与多态性、绑定方法和非绑定方法
多态与多态性 多态 多态并不是一个新的知识 多态是指一类事物有多种形态,在类里就是指一个抽象类有多个子类,因而多态的概念依赖于继承 举个栗子:动物有多种形态,人.狗.猫.猪等,python的序列数据类 ...
- 关于Mysort实验的补发博客
关于本次课后的一些话 关于这次课上的关于sort -nk 2 -t: sort.txt的实验没能在课上做出,有自身的知识不够,没能灵活运用所学知识,以及在当时课上走了会神,回过头来已经不知道该干些什么 ...
- Problem G: 十进制数转换为二进制数
#include<stdio.h> int main() { ]; while(scanf("%d",&n)!=EOF) { ; ) { a[i++]=n%; ...
- Scala 匿名函数
Scala 中定义匿名函数的语法很简单,箭头左边是参数列表,右边是函数体. 使用匿名函数后,我们的代码变得更简洁了. 下面的表达式就定义了一个接受一个Int类型输入参数的匿名函数: var inc = ...
- 工作流 jBMP4.4表结构
(一)资源库和运行时表结构 JBPM4_DEPLOYMENT, JBPM4_DEPLOYPROP, JBPM4_LOB 存储流程定义相关的部署信息 JBPM ...
- Win32 error code message
http://fit.c2.com/fit/files/LispPlatform/lisp/clisp-2.28/src/errwin32.d # Calls a function, passing ...