In my ativity's onCreate(), I set a MediaPlayer.OnCompletionListener, then play an MP3 file:
MediaPlayer p = MediaPlayer.create(this, R.raw.intro);
p.setOnCompletionListener(this);
p.start();
And when playing ends, I just handle this event in:
public void onCompletion(MediaPlayer mp) {
// handle completion
}
All nice and dandy but now I want to play two different MP3 files and handle completion differently based on which file was played.
Is there a way to tell from the MediaPlayer
parameter which piece ended?