Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序上,我显示了很多注意事项。如果用户关闭设备几个小时,打开时会收到很多通知。有一种方法可以只使用一次声音,而不是每次通知一次?
使用 FLAG_ONLY_ALERT_ONCE:
Notification notification = notificationBuilder.build(); notification.flags = Notification.FLAG_ONLY_ALERT_ONCE; notificationManager.notify(notificationId, notification);