Understood your problem now. I'm assuming your media player implementation is working fine, and you just to call back your original activity after music has finished.
You can use the Completion Listener of Media Player class to do this.
mediaPlayer.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
Log.i("Completion Listener","Song Complete");
/* Put your code to call back your activity here */
}
});
You can call back your original activity by variety of methods like startActivity(intent)
. Basically, on completion of audio track, your listener will be called, then you can decide what to do. You can just print a message or you can call any activity you wish.
Here's the complete DEMO