且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android:在应用程序的设备中管理多个推送通知

更新时间:2023-11-22 16:34:40

尝试放入不同的通知ID(即nid),并为每个新通知通知而不是0,这将防止覆盖您的通知

Try to put different notification id (i.e. nid) in intent and notify instead of 0 for each new notification this will prevent over writing your notification

  PendingIntent intent = PendingIntent.getActivity(context, nid,notificationIntent, 0);

notificationManager.notify(nid, notification);

希望这对您有帮助