问题标签 [foregroundnotification]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
19 浏览

android - 如何在通知图标不闪烁的情况下更新通知进度?

在我的 Android 应用程序中,我正在下载Foreground Service. 在开始下载之前,我会显示一个进度为 0 的通知,然后更新进度NotificationBuilder。我面临的问题是通知小图标在更新进度时不断闪烁,NotificationBuilder即使我正在重复使用相同的NotificationBuilder。我也设置setOngoing=true了,但这不起作用,也尝试设置setOnlyAlertOnce=true

下面是我的代码

有人可以帮我解决这个问题吗?任何帮助将不胜感激。

谢谢

0 投票
0 回答
12 浏览

android - workmanager foregroundInfo 未显示通知

我想创建一个带有抬头功能的通知。基本上它是一个警报功能。我想用通知显示foreground。现在workmanager具有使用setForeground . 但它没有显示通知,因为我实现它如下:

调用 notificationManager.notify(id, builder.build()) 时会显示通知,但不会保持很长时间。如何让抬头通知保持很长时间?