Exemplo n.º 1
0
 private void playSong() {
   try {
     mMediaPlayer.seekTo(0);
     mMediaPlayer.start();
   } catch (IllegalStateException e) {
     e.printStackTrace();
   } catch (IllegalArgumentException e) {
     e.printStackTrace();
   }
 }
Exemplo n.º 2
0
 private void setupSong() {
   try {
     mWasPaused = false;
     mMediaPlayer.reset();
     mMediaPlayer.setDataSource(mSelectedDataSource);
     mMediaPlayer.prepare();
   } catch (IllegalStateException e) {
     e.printStackTrace();
   } catch (IllegalArgumentException e) {
     e.printStackTrace();
   } catch (IOException e) {
     e.printStackTrace();
   }
 }