will be helpful for those in need 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
JavaFX MediaPlayer playing background music loop with small intro music
I wish this help you After experience with other well-known game engines (e.g. Unity), I found that the files should be in .wav format as opposed to .mp3 format. This will allow the music to be looped seamlessly.
How to make notification dismissible when playing music in background like in Spotify and Google Music
around this issue I think you can have a timer in your service that restarts your service after a while if the user stopped the music your timer will keep it from dying and if the user clicked play button do as what you already do before.