Android: After creating a new notification, the older one is replaced

前端 未结 3 982
耶瑟儿~
耶瑟儿~ 2021-02-18 17:43

I want to create a notification without canceling/deleting previous notifications from my app. Here is my code for creating a notification:

private void notifica         


        
3条回答
  •  广开言路
    2021-02-18 18:36

    You are using a hardcoded id for your notification, of course it will replace the old one. Try using a variable ID instead of a hardcoded 100.

    mNotificationManager.notify(100+x, mBuilder.build());
    

    or something of the sort.

提交回复
热议问题