对Android Handler Message Looper常见用法,知识点的一些总结
Android 非UI线程中是不能更新UI的,Handler是Android 提供的一套更新UI的机制,也是用来发送消息和处理消息的一套机制。 以前刚接触的Handler的时候,感觉总是很困惑,对Handler原理也是一知半解,现在对Handler常见用法,知识点总结一下。 先看一下谷歌Android官方文档对Handler的描述: Class Overview A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue . Each Handler instance is associated with a single thread and that thread's message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on, it will deliver messages and runnables to that message queue and execute them as they