Code example for MediaPlayer

Methods: releasestop

0
     
    public void stopPlayback() { 
        if (mPlayer == null) // we were not in playback
            return; 
 
        mPlayer.stop();
        mPlayer.release();
        mPlayer = null;
        setState(IDLE_STATE);
    } 
     
    public void stop() { 
        stopRecording(); 
        stopPlayback(); 
    } 
 
    public boolean onError(MediaPlayer mp, int what, int extra) {
        stop(); 
        setError(SDCARD_ACCESS_ERROR);
        return true; 
Connect your IDE to all the code out there  Get Codota for Java