Reputation: 12059
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?
//André
Upvotes: 1
Views: 4902
Reputation: 2153
Take a look over here.This will solve your problem. https://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/
Upvotes: 3