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

  1. 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消息传递机制 ...

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

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

  4. Android handler 报错处理Can't create handler inside thread that has not called Looper.prepare()

    问题: 写了一个sdk给其他人用,提供一个回调函数,函数使用了handler处理消息 // handler监听网络请求,完成后操作回调函数 final Handler trigerGfHandler ...

  5. 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报 ...

  6. 在子线程中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 ...

  7. 关于子线程使用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 ...

  8. Can’t create handler inside thread that has not called Looper.prepare()

    1)在Android 2.3以前,为防止ANR(Application Not Responding),Google是不赞成将网络连接等一系列耗时操作直接放到应用主线程进行的,推荐将这类操作放在子线程 ...

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

随机推荐

  1. 洛谷——P1629 邮递员送信

    P1629 邮递员送信 题目描述 有一个邮递员要送东西,邮局在节点1.他总共要送N-1样东西,其目的地分别是2~N.由于这个城市的交通比较繁忙,因此所有的道路都是单行的,共有M条道路,通过每条道路需要 ...

  2. Sqli-labs less 1

    Less-1 我们可以在http://127.0.0.1/sqllib/Less-5/?id=1后面直接添加一个 ' ,来看一下效果: 从上述错误当中,我们可以看到提交到sql中的1'在经过sql语句 ...

  3. VB查询数据库之登陆窗体——机房收费总结(一)

    机房收费系统已经做了很长一段时间了,虽然到目前为止,仍然没有结束,但已经结节尾声了.我感觉现在有必要回首总结一下整个机房收费系统. 除了结账做了一半,报表接触一点之外,其他的都基本上差不多了.从做过的 ...

  4. AGC 012 D - Colorful Balls

    题面在这里! 为什么atcoder都是神仙题啊qwq 首先发现如果要让 x,y 互换位置的话,要么通过他们直接换 (也就是x和y满足两种操作之一),要么间接换,通过一些其他的元素形如 x可以和 a[1 ...

  5. 【图论】Network of Schools

    [POJ1236]Network of Schools Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18969   Acc ...

  6. Problem F: 逆序排列

    #include<stdio.h> void sort(int *p,int n) { int i,t; ;i<n/;i++) { t=*(p+i); *(p+i)=*(p+n-i- ...

  7. MATLAB/Octave中implicit conversion from real matrix to real scalar错误原因与解决

    写程序时提示 implicit conversion from real matrix to real scalar的一个warning,主要问题在于将一个矩阵当成一个标量在使用.我的程序出现这个wa ...

  8. QPS相关的概念收集(吞吐量(TPS)、QPS、并发数、响应时间(RT))

    一.概念: 1.响应时间(RT) 响应时间是指系统对请求作出响应的时间.直观上看,这个指标与人对软件性能的主观感受是非常一致的,因为它完整地记录了整个计算机系统处理请求的时间.由于一个系统通常会提供许 ...

  9. express结合EJS模板渲染HTML

    注意:以下是在Windwo环境下 运行: npm install ejs 然后你的目录node_modules下将增加ejs文件夹 app.js var express = require(" ...

  10. ATL7窗口类详细剖析

    前言: ATL是微软继MFC之后提供的一套C++模板类库,小巧.精妙.效率极高.它的主要作用是为我们编写COM/DOM/COM+程序提供了丰富的支持.但是ATL只能写COM么?我以前只是MFC程序员的 ...