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

前端 未结 3 996
耶瑟儿~
耶瑟儿~ 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:40

    Use variable id for notification, I have faced this issue 1 Hour ago And used this technique to overcome this issue.

            val id= Random(System.currentTimeMillis()).nextInt(1000)
            mNotificationManager?.notify(id, mBuilder.build())
    

提交回复
热议问题