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 ...
随机推荐
- Flask实战第50天:cms添加轮播图的模态对话框制作
编辑cms_banners.html, 在{% block main_content%}中加上表给内容如下 {% block main_content %} <table class=" ...
- 单能X射线产生方法
主要是荧光 利用布拉格准则, 关键词如下.. 国内有些专利 monochromating crystal spectrometer 物理实验设备名称翻译 ... 单色光检糖计 monochromati ...
- Java并发(三):重排序
在执行程序时为了提高性能,提高并行度,编译器和处理器常常会对指令做重排序.重排序分三种类型: 编译器优化的重排序.编译器在不改变单线程程序语义的前提下,可以重新安排语句的执行顺序. 指令级并行的重排序 ...
- httpWebRequest 文件下载
服务版本: go file system ssdb github: https://github.com/dtxlink/gfs 上一篇: 一个 go 文件服务器 ssdb 通过 httpWebReq ...
- 关于智能硬件设备shell安全设计
问题描述: 在对某些智能硬件设备进行测试时,发现有些设备直接提供了Linux shell,并且登录账号默认是root权限!在登录到设备后,在bin目录下可以看到很多命令行程序,这些程序大部门用户用不到 ...
- Linux 的硬链接与软链接
Linux 的硬链接与软链接 http://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-links/ 若一个 inode 号对 ...
- Linux操作系统下的常见系统资源共享
转:http://www.360doc.com/content/07/0420/10/25127_457022.shtml linux下如何挂接(mount)光盘镜像文件.移动硬盘.U盘.Window ...
- iOS开发--地图与定位
概览 现在很多社交.电商.团购应用都引入了地图和定位功能,似乎地图功能不再是地图应用 和导航应用所特有的.的确,有了地图和定位功能确实让我们的生活更加丰富多彩,极大的改变了我们的生活方式.例如你到了一 ...
- Object.keys()的简单理解
1.对象的话返回属性名 var obj = {'a':'123','b':'345'}; console.log(Object.keys(obj)); //['a','b'] var obj1 = { ...
- JBoss入门
很多内容摘自 https://www.jianshu.com/p/4baaf549436b 1.安装目录 安装完Jboss后得目录结构 目录 功能 appclient/ 包含应用程序客户容器的配置细节 ...