Reputation: 453
I am implementing an app that receive push notifications. I have used flag Notification.FLAG_INSISTENT
to continuously play sound until user drag notification panel. But I want to stop the sound on app resume rather than on dragging notification panel.
Upvotes: 0
Views: 836
Reputation: 6849
According to documentation, for notifications with FLAG_INSISTENT
audio will be repeated until the notification is cancelled or the notification window is opened.
So when you resume your activity you can cancel your notification. if you want it to stay in the notification window, then redisplay it again without sound and the insistent flag.
Upvotes: 2