• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Notification timing out on Android Wear after seconds

I have used the following tutorial to create a notification:

https://code.tutsplus.com/tutorials/background-audio-in-android-with-mediasessioncompat--cms-27030

This works without any issues on handheld devices. Though, on Android Wear, the notification is displayed properly until I hit pause and go to the main screen. After 20-30 seconds the notification is gone.

I have tried everything I can think of to keep the notification on, without luck, including setTimeoutAfter(-1) on the notification builder. Note that the notification does not disappear as long as there is a track playing.

I have seen an audio player app on the store that works properly. So, I know it can be done. There is also another issue with the notification. If I stop the track completely and dismiss the notification, I get a black screen on Android Wear. I would have swipe down and up to get rid of it.

Any information is appreciated. Thank you.

P.S. I have spent the last five hours searching non-stop on stackoverflow and Google without luck.
 
Back
Top Bottom