I am creating a TODO list app which accepts Notification time and date. Whenever i add a new scheduled notification my old notification get cancelled and the notification which i entered last alone works.
For example:
if i set a notification on 1,2,3 minute respectively i only get the final notification that is only one notification after 3 minutes.
Can someone explain how to clear this problem. If someone can pls share the code of broadcast and the defining and calling part of notification
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
2
Answers
This happens because your notifications have the same id.
When you call
NotificationManagerCompat.notify(id,notification)
,use a different id for different notifications.
I’m assuming, each notification replaces the previous one rather than generating its’ own id. Fix that and you’ll be on your way.