摘要: 一、Handler是什么? 在Android开发中,使用消息队列(message)完成线程间通信。而使用消息队列的线程就是消息循环(message looper)。消息循环不断的检查消息队列,是否有新消息。消息循环是由一个线程和一个looper组成;looper对象管理着线程的消息队列。 Andro 阅读全文
posted @ 2018-04-25 11:15 naray 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 在Handler基础篇中讲述了Handler原理和使用,下面是从Handler源码进一步解析Handler。 一、源码解析 1. Handler的构造函数 1 /** 2 * Use the {@link Looper} for the current thread with the specifi 阅读全文
posted @ 2018-04-25 11:14 naray 阅读(1628) 评论(0) 推荐(0) 编辑