Search code examples
androidmedia-player

Music stops playing on certain devices and keeps playing on others


Hi everyone I recently made an application that is actually a media player of a football club ultras music. I tested it on my phone (Motorola X running Android 4.4.4) when i go back to the dashboard the music keeps playing and everything is OK. But I had a review that on Samsung Trend Plus running Android 4.2.2 the music stops playing when going back to dashboard. I didn't know what may cause this issue? any ideas? Thanx


Solution

  • Most likely your problem is with audio focus. On certain system, when user go to the dashboard, the launcher might take audio focus (and pause your audio play) to play its launch sound (the clicking noise or w/e). Right after that, it should hand back audio focus to you and you will need to resume your playing.

    http://developer.android.com/training/managing-audio/audio-focus.html