Handler机制
2019-12-12 11:47:36 0 举报
Handler
作者其他创作
大纲/内容
Handler
#mQueue:MessageQueue#mLooper:Looper
+dispatchMessage(msg:Message)+handleMessage(msg:Message)+obtainMessage():Message+sendMessage(msg:Message)+removeMessage()
Looper
#sThreadLocal:ThreadLocal<Looper>-mMainLooper:static Looper#mQueue:MessageQueue#mThread:Thread
+prepare()+loop()+myLooper()+quit()
MessageQueue
#mMessages:Message
Handler机制UML
Handler有mQueue和mLooper对象
+Message有一个Handler对象
+MessageQueue有一个mMessages消息
Message
+what:int+arg1:int+arg2:int+obj:Object#when:long#trraget:Handler#next:Message
+Obtain():Message+recycle()
+Looper有一个mQueue消息队列
0 条评论
下一页