请问大家:    执行handleMessage()的线程是Looper吗?当sendMessage时,是加入到当前线程的messageQueue吗?
    请说的详细些.

解决方案 »

  1.   

    http://dev.10086.cn/cmdn/wiki/index.php?edition-view-5398-1.html
      

  2.   

    1.如果在线程里边调用Looper.loop()方法,会创建一个与该线程一一对应的looper对象,并从该looper对象中获取消息队列,从消息队列中获取消息,再从该消息中获取发送该消息的handler对象,调用其dispathMessage方法,从而调用用户自己实现的handleMessage方法。一般用的looper都是main线程的looper,所以执行handleMessage的线程就是主线程。
    2.当调用handler的sendMessage方法时,会向handler创建时所在线程的messageQueue发送,如果handler是在主线程中创建的,则会向主线程的消息队列发消息。