title: Android Mediaplayer Selecttrack method fails
body: <p>I am using the mediaplayer feature on Android. I basically have songs in the raw folder and I would just like to change to a new track but it fails. One music file plays and then I press a button after or during the music playing to skip to a random track but it fails. </p>
  
  <p>Current code</p>
  
  <pre><code>mediaplayer.stop();
  try {
          mediaplayer.prepareAysn();
          mediaPlayer.selectTrack(randomtrack_num - 1);
  
      }
      catch(Exception e){}
  mediaplayer.start();
  </code></pre>
  
  <p>The error that I receive: </p>
  
  <ul>
  <li><p>MediaPlayer: start called in state 64</p></li>
  <li><p>MediaPlayer: error (-38, 0)</p></li>
  <li><p>MediaPlayer: Error (-38,0)</p></li>
  </ul>
  
  <p>I tried this without mediaplayer.stop() and still included mediaplayer.start() at the end and it would just replay the same track again.</p>
  
  <p>Am I missing something? 
  Please let me know.</p>
  
  <p><strong>2nd Approach</strong>
  After reading the document I realized this can only be done in the prepared state which I assume in my second approach it should work but it is not.</p>
  
  <pre><code>  mediaPlayer.stop();
  
      mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener(){
  
          @Override
          public void onPrepared(MediaPlayer mp) {
  
            try{
                 mp.selectTrack(randomtrack_num - 1);
  
                }catch(Exception e){}
  
              mp.start();
  
          }
      });
      mediaPlayer.prepareAsync();
  </code></pre>
  
  <p>I get this error:/MediaPlayer: Should have subtitle controller already set
  Basically the same track plays again and it does not go to the selected track.</p>