V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nnegier
V2EX  ›  Android

Android 的通知更新 notify 有时会很慢?

  •  
  •   nnegier · 194 天前 · 2138 次点击
    这是一个创建于 194 天前的主题,其中的信息可能已经有所发展或是发生改变。
    nm.notify(NotificationUtil.TIMING_NOTIFICATION_ID, mTimingNotificationBuilder.build());
    

    主要是更新了 Actions 之后再 notify 有时会很慢,大约间隔 2 秒后会刷新成功,比较高频出现:

    mTimingNotificationBuilder.mActions.clear();
    for (NotificationCompat.Action action :actions) {
    	mTimingNotificationBuilder.addAction(action);
    }
    

    这个问题困扰我挺久的,完全没有头绪,你说它不正常 notify 成功还好,但就是要隔一段肉眼可见的时间才能正常 notify 成功。关于那 Actions 总共就 4 个,两两一组根据业务条件更换。

    一些其它信息:

    • 是前台通知;
    • Priority 设置的是 PRIORITY_MAX ,感觉这个没啥影响;
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5896 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 03:17 · PVG 11:17 · LAX 20:17 · JFK 23:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.