Android: Managing Multiple Notifications

前端 未结 2 996
萌比男神i
萌比男神i 2020-12-31 13:53

I am trying to create multiple notifications in my application. To identify each notification uniquely, i have given them an unique identificationId. Following is my code:

2条回答
  •  醉话见心
    2020-12-31 14:54

    just place the notificationId instead of 0 in pendingIntent.

    PendingIntent.getActivity(this, notificationId, intent,PendingIntent.FLAG_UPDATE_CURRENT));
    

    The user must also update the following code together with the above one to get it working.

     mNotificationManager.notify(notificationId, mBuilder.build());
    

提交回复
热议问题