In Android 6.0, there is a slight change in the way notifications / summary notifications are displayed. If you constantly send many notifications, the notification system does not display heads-up if there is a very short duration between successive notifications.
To confirm this, first add this code to the second notification constructor inside this if statement (this was not enough in the code to show it as a high priority and with a warning):
.setPriority(Notification.PRIORITY_HIGH) .setDefaults(Notification.DEFAULT_ALL)
and then test the release notice every couple of seconds (let the previous heads-up notification disappear, and then wait a few seconds). If you are correct, you should see an alarm display for each notification.
If you start sending notifications several times, and very fast heads-ups will not appear. Just wait 1-2 minutes, and then release it again, then it will appear in heads-up.
Rafay ali
source share