Handler.postDelayed和View.postDelayed有何区别

books1958 2013-12-04 02:10:20
如题,看源码中方法的注释好像没啥区别的。
...全文
596 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
小白在此 2016-04-17
  • 打赏
  • 举报
回复
看源码
 public boolean postDelayed(Runnable action, long delayMillis) {
        final AttachInfo attachInfo = mAttachInfo;
        if (attachInfo != null) {
            return attachInfo.mHandler.postDelayed(action, delayMillis);
        }
        // Assume that post will succeed later
        ViewRootImpl.getRunQueue().postDelayed(action, delayMillis);
        return true;
    }
View.postDelayed也是利用handler.postDelayed实现的。所以本质上应该没有区别。
books1958 2013-12-10
  • 打赏
  • 举报
回复
没有人回复啊。。。
books1958 2013-12-05
  • 打赏
  • 举报
回复
自己顶一下。 Handler.postDelayed和View.postDelayed有何区别呢?
mmorss 2013-12-04
  • 打赏
  • 举报
回复

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧