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主线程当中这样处理大事件时不能用此方法开启线程,

要使用

的方式开启线程。

相关文章:

  • 2022-03-03
  • 2021-10-29
  • 2021-10-18
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-07-16
  • 2021-12-06
  • 2021-05-18
  • 2022-02-06
相关资源
相似解决方案