title: IllegalStateException in MediaPlayer set datasource method
body: <p>I'm using the following code in my <code>onCompletion</code> listener of <code>MediaPlayer</code> where I'm repeating the current song.</p>
  
  <pre><code>if (isRepeat) {
                  if (mMediaPlayer.isPlaying()) {
                      mMediaPlayer.stop();
                      mMediaPlayer.reset();
                  }
                  try {
                      mMediaPlayer.setDataSource(MainActivity.localTrackList.get(MainActivity.currentOffset).getPath());
                      mMediaPlayer.prepareAsync();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
  </code></pre>
  
  <p>But I'm getting the following error Message,</p>
  
  <pre><code>  at android.media.MediaPlayer._setDataSource(Native Method)
  09-15 09:05:19.884 12545-12545/ W/System.err:     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1115)
  09-15 09:05:19.884 12545-12545/ W/System.err:     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1100)
  09-15 09:05:19.884 12545-12545/ W/System.err:     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1079)
  09-15 09:05:19.884 12545-12545/ W/System.err:     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1028)
  </code></pre>
  
  <p>How can I be able to sort this out?</p>