您当前的位置: 首页 >  android

韩曙亮

暂无认证

  • 1浏览

    0关注

    1068博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

【Android 异步操作】Handler 机制 ( MessageQueue 空闲任务 IdleHandler 机制 )

韩曙亮 发布时间:2020-11-05 22:27:57 ,浏览量:1

文章目录
  • 一、MessageQueue 空闲任务 IdleHandler 机制
  • 二、MessageQueue 中空闲任务 IdleHandler 相关源码

一、MessageQueue 空闲任务 IdleHandler 机制

在 消息队列 MessageQueue 的 next 获取下一条消息的方法中 ,

在循环获取消息的最后有如下代码 :

public final class MessageQueue {
    @UnsupportedAppUsage
    Message next() {
    	// ...
                // If first time idle, then get the number of idlers to run.
                // Idle handles only run if the queue is empty or if the first message
                // in the queue (possibly a barrier) is due to be handled in the future.
                if (pendingIdleHandlerCount             
关注
打赏
1663594092
查看更多评论
0.0429s