Пример #1
0
 private void playSong() {
   try {
     mMediaPlayer.seekTo(0);
     mMediaPlayer.start();
   } catch (IllegalStateException e) {
     e.printStackTrace();
   } catch (IllegalArgumentException e) {
     e.printStackTrace();
   }
 }
Пример #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();
   }
 }