Code example for MediaPlayer

Methods: isPlayingprepareseekTostop

0
            isPaused = true;
        } 
    } 
 
    public void stop() { 
        if (mediaPlayer.isPlaying() || isPaused) {
            try { 
                mediaPlayer.stop();
                mediaPlayer.prepare();
                mediaPlayer.seekTo(0);
            } catch (IllegalStateException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } 
 
            isPaused = false;
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE