[Solved] Android MediaPlayer continues playing after screen is turned off


You should stop the MediaPlayer in onPause:

if (playback != null && playback.isPlaying()) {
        playback.pause();
    }

Resume it in onResume:

if (playback != null && !playback .isPlaying()) {
                playback.start();
    }

2

solved Android MediaPlayer continues playing after screen is turned off