转载:Handler步骤小结(在线程中更新UI和了解HandlerThread类的用法)

转载:Handler方法小结(在线程中更新UI和了解HandlerThread类的用法)
小结:

    * 1、向哪个Handler 发送消息,就必须在哪个handler 里面接收;
    * 2、直接使用JAVA 的 Thread 是无法更新Android UI的,因为Android View 在设计的时线程是不完全的,不过Android 提供了几种供开发者在线程中更新UI的方法,如下:
          o Activity.runOnUiThread( Runnable )
          o View.post( Runnable )
          o View.postDelayed( Runnable, long )
          o Hanlder
    * 3、直接使用hanlder .post 等方法是在当前主线程里面做操作,而不是另外新建线程,建议使用Thread 线程直接新建另外一个线程或者使用HandlerThread类也可以。
    * 4、记住消息队列的先进先出原则。