Darshana
Darshana

Reputation: 453

Android push notification stop repeating sound on activity resume

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

Answers (1)

A. AMAIDI
A. AMAIDI

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

Related Questions