search

Home  >  Q&A  >  body text

android - 多个notification通知栏一个小图标如何实现

notificationmanager弹出一个通知就会显示一个小图标,如何让一个应用程序的通知只在屏幕上面只显示一个小图标,如微信那种的

高洛峰高洛峰2887 days ago511

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:40:14

    Each notification has an ID and can also be canceled.
    Every time you send a new notification, cancel the old notification, so that there is only one notification icon on the notification bar.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:40:14

    When NotificationManager calls notify, one parameter is id. If the ids are the same, only one will be displayed (the latter one will update the previous one). If the ids are different, multiple ones will be displayed.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 17:40:14

    Just use the same id, but then the previous notification will be replaced. With the concept of group notification in Android N, your problem will be easily solved.

    reply
    0
  • Cancelreply