Loading

java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

不可以在子线程中更新UI线程

Toast或者Dialog中都有一个Handler的成员变量,在初始化时都会跟着初始化,而Toast或者Dialog中的Handler都需要一个Looper,所以需要在包含该Toast或者Dialog的线程中(如下面的Timer线程)初始化Looper。Looper.prepare();

http://jeff-pluto-1874.iteye.com/blog/869710

posted @ 2014-07-20 16:34  The Mechanic  阅读(263)  评论(0编辑  收藏  举报