I am going to create music player that play the mp3 files in background. I put play pause stop button in my app. Everything is working fine till i again start my application. Like if i again start my app after playing music from my app. Then both the files will play in background. i am using
private MediaPlayer mp = new MediaPlayer();
so, a new object is created every time. How can i stop my previous playing file before starting new file.
You have several options.