title: Android: Background music is playing while lock screen is on
body: <p>If my activity is running in the foreground and the display is turned off and then turned back on again the background music starts to play again before the screen is unlocked. The background music is paused in onPause() and continues to play in onResume(). So when the app is pushed to the background the music stops. 
  Is there a way to prevent the music from playing while the lock screen is on?</p>
  
  <p>//André</p>