1
votes

I already asked about it before, but my question even after edits about my progress of fix this noone answered to it anymore. This is original question: Android media player stop playing while in background

So in short, I'm making music player app, but mediaPlayer stop sometimes when loading next song. After many tests I find out that it stops at mediaPlayer.prepare() and it won't continue as long as I don't trigger any action on phone like turning on display, volume up/down, click headset button. I'm out of ideas what can be a reason of it.

1
Not sure but using a foreground Service might help you. foreground service have higher priority than normal services and they will keep up and running in most of the cases that a service might suspend or be killed. - VSB
I already using it, like already someone sugested, but no luck. - Hato
Did you find a solution for this? - flackbash

1 Answers

0
votes

maybe you need to call prepareasync() instead of prepare().