Add a new notification when push notification is received (not replace the previous)

前端 未结 6 1883
予麋鹿
予麋鹿 2021-02-02 16:59

I am using push notifications in my app. I need to display a notification when a push notification delivered. If I send another notification (without clearing the previous notif

6条回答
  •  花落未央
    2021-02-02 17:32

    Use a new notification ID every time instead of hardcoding to 1:

    int i = x; //Generate a new integer everytime
    mNotificationManager.notify(i, notification);
    

提交回复
热议问题