Snowberg

 

关于Handler.post(Runnable runnable)的解释

http://stackoverflow.com/questions/5316393/handler-looper-implementation-in-android

http://developer.android.com/reference/android/os/Handler.html#post(java.lang.Runnable)

Causes the Runnable r to be added to the message queue. The runnable will be run on the thread to which this handler is attached.


这里是指这个Runable会加入的消息队列当中,同时会在handler所在的线程上运行。


也就是说,post(Runnable runnable) 并没有开启新的线程,这时我们就要注意了,当我们在UI主线程当中这样处理大事件时不能用此方法开启线程,

要使用

的方式开启线程。

posted on 2012-03-21 21:42  Snowberg  阅读(1669)  评论(0编辑  收藏  举报

导航