V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nnegier
V2EX  ›  Android

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

  •  
  •   nnegier · Mar 4, 2025 · 3408 views
    This topic created in 421 days ago, the information mentioned may be changed or developed.
    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 ,感觉这个没啥影响;
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5541 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 06:41 · PVG 14:41 · LAX 23:41 · JFK 02:41
    ♥ Do have faith in what you're doing.