Search code examples
androidandroid-5.0-lollipop

Dismissing MediaStyle notifications


New Android MediaStyle notifications in Lollipop don't have a dismiss button. Looks like there is already a bug for it on Google Code.

Does anyone know what's a good workaround for this issue until the bug is resolved?

Should we just delay switching to MediaStyle? Or use one of the actions as the dismiss button?


Solution

  • One mechanism which appears to work quite well is make the notification ongoing while music is playing and make it not ongoing (allowing it to be swipe dismissed) when the music is paused. This seems to be the technique that Google Music already uses.