title: How To Play MediaPlayer's Next Song without reaching the End of the Current song
body: <p>i have a music player app and it cuts which part of a track should be played.
  my question is how do i play the next song even if the current mediaplayer track hasn't reached the end of song. I also tried calling the onCompletion :</p>
  
  <pre><code>mplayer.stop();
  
          Log.v("PLAYER", "Audio track Stopped");
          checkTrackStatus();
          songHandler.removeCallbacks(uxUpdater);
          if(fis!=null)fis=null;
  
          if((currentTrack+1) &lt; songs.size())
          {
  
              Log.v("Move to next track", songs.get(currentTrack+1).get("songTitle"));
              //mplayer.release();
              mplayer=null;
              currentTrack++;
              playSong(currentTrack);
  
          }else
              Toast.makeText(getApplication(), "All tracks played", Toast.LENGTH_LONG).show();
  </code></pre>
  
  <p>PLAY SONG METHOD:</p>
  
  <pre><code>public void playSong(final int songIndex)
  {
          File toPlay = new File(songs.get(songIndex).get("songPath"));
  
          lblTrackText.setText("Playing ["+(songIndex+1)+"/"+songs.size()+"]");
          lblTrackTitle.setText(songs.get(songIndex).get("songTitle"));
          //lblTrackTitle.setSelected(true);
  
  
          Log.v("PLAY SONG : ", toPlay.getPath());
          if(toPlay.exists())
          {
              //playAudio(toPlay);
  
              try{
  
                  mplayer = new MediaPlayer(this);
                  //mplayer.setOnCompletionListener(this);
                  fis=new FileInputStream(new File(songs.get(songIndex).get("songPath"))); //ORIGINAL 'p'
                  mplayer.setDataSource(fis.getFD());//need to add permission in manifest to play .m4a files "ACCESS_NETWORK_STATE"
  
                  mplayer.prepare();
  
  
  
  
                  //final String s =p;
                  mplayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
  
                      //getTotalTrackDuration
  
                      @Override
                      public void onPrepared(MediaPlayer mp) {
                          mplayer.seekTo(Integer.parseInt(songs.get(songIndex).get("songStart")));
                          mplayer.start();
                          //lblTotal.setText(timeConverter(mplayer.getDuration()));
                          setTrackNo();
  
                          //Log.v("NOW PLAYING ", s);
                          updateProgress();
                      }
                  });
  
          } catch (Exception e) {
              Log.e("AUDIO PLAYER", "error: " + e.getMessage(), e);
          }
  
          }
          else
              Toast.makeText(getApplication(), songs.get(songIndex).get("songTitle")+" does not exist or is already deleted", Toast.LENGTH_LONG).show();
  
  
  }
  </code></pre>
  
  <p>i always get an error saying </p>
  
  <p>Error(1,-541478725)
  Fatal Signal 11 (SIGSEGV) at 0x00002ad8 (code=1)</p>
  
  <p>i'm using vitamio media player by the way.</p>
  
  <p>Any help would be great..thanks</p>