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 ...
随机推荐
- 【动态规划】mr351-办签证
[题目大意] xuzhenyi要办个签证.办证处是一座M层的大楼,1<=M<=100. 每层楼都有N个办公室,编号为1..N(1<=N<=500).每个办公室有一个签证员. 签 ...
- vue组件续和前端工程化
1.3 插槽 slot template: ` <button> <slot></slot> </button> ` <my-button> ...
- Problem E: 零起点学算法34——3n+1问题
#include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...
- C# mvc Request 请求过长报404错误的解决思路分析
案例 我们需要根据index 页面选取值 然后 在弹出页面展示已经选取的值 但其实Request 超出请求长度,后来经过模式解决了. 分享如下 1.设定 web.config 里面的 在web.con ...
- 技术分享:杂谈如何绕过WAF(Web应用防火墙)(转)
0×01开场白 这个议题呢,主要是教大家一个思路,而不是把现成准备好的代码放给大家. 可能在大家眼中WAF(Web应用防火墙)就是"不要脸"的代名词.如果没有他,我们的" ...
- 研究人员发现绝大部分酷派(Coolpad)手机暗藏后门(转)
隐私问题被曝光得越来越多,随着物联网的发展,只会变得越来越严重,不过从当前看来 ,国人对隐私的重视度还远没有国外,期待加强对隐私的保护策略. 转自:http://www.freebuf.com/n ...
- 转载:通过扩大IE使用内存,解决skyline在IE下模型不能加载的方法
转自:https://www.cnblogs.com/cannel/p/5261009.html 环境:skyline TerraExploere 6.6,win 10 sp1 64位,ie 11 情 ...
- Hibernate 注解@Column(nullable = false) 和 @Column(unique=true)
unique=true是指这个字段的值在这张表里不能重复,所有记录值都要唯一,就像主键那样; nullable=false是这个字段在保存时必需有值,不能还是null值就调用save去保存入库;
- 实现同时提交多个form(基础方法) 收集
实现同时提交多个form(基础方法) 收集 分类: 1.2-JSP 1.3-J2EE 1.1J2se 1.0-Java相关2011-12-01 20:59 1644人阅读 评论(0) 收藏 举报 bu ...
- [转]SSIS ConnectionManager.ConnectionString Property
本文转自:http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.connectionmanager.conne ...