java.lang.RuntimeException:Can't create handler inside trhead that has not called Looper.prepare
来源:互联网 发布:java字符串双引号转义 编辑:程序博客网 时间:2024/05/16 17:02
先看一下错误的日志吧!
我启用线程的目的是未来下载多张图片,并且是在线程里面下载的,但是有时候下载并不顺利,并且出现了致命性的错误,错误如上图所示。
决解错误后的代码如下:
下面就来分析上面的代码吧!
我下载错误的原因是,当我正在执行下载图片的时候,突然我的服务器崩掉了,而在 catch{}里面就捕获到异常,而之前我在里面没用做任何的处理,那么程序还得继续往下运行,运行到画蓝色的圈圈就出错了。
因此要决解的办法就是,当扑捉到异常的时候,我们就要执行跳出 run( )里面的循环,在跳出之前把进度条销毁掉,跳出循环用的是 return ,不能用break,具体是为什么我也搞不清楚,我是测试到得结论的。
0 0
- java.lang.RuntimeException:Can't create handler inside trhead that has not called Looper.prepare
- 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.prepare()
- 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.prepare()
- 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.prepare()
- 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.prepare()
- 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.prepare()
- Android 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.prepare()
- 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.prepare()
- 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.prepare()
- java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
- 用java调用oracle存储过程总结
- 编译loongson内核1b-linux-3.0-20130104问题总结
- 转自 https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-nginx-for-cent
- SpringAOP案例(一)XML方式
- 线程之ReadWriteLock用法
- java.lang.RuntimeException:Can't create handler inside trhead that has not called Looper.prepare
- 如何在visual2012里,调用(或引用)DeleteObject方法
- Linux的inode的理解
- java jsp el fn
- 【移动开发】Android中三种超实用的滑屏方式汇总(ViewPager、ViewFlipper、ViewFlow)
- 苹果公司发布iPhone 5s和iPhone 5c
- sql server 游标使用简示例
- c&c++程序优化几个建议
- ejb3persistence.jar javax.persistence的注解配置