I have to fire my notification 30 times in order to play the alarm sound 30 seconds continuously. But the process needs to get out of the loop if the user remove the notification from the notification pool? What is the best way to do this?
for(int i ; i < 30; i++) {
notificationManager.notify(tag, NOTIFICATION_ID, notification);
Thread.sleep(1000);
}