The problem is that you are trying to reuse a MediaPlayer object after it has been released.
so remove mp.release()
if(mp.isPlaying())
{ mp.stop();
// mp.release();
}
and release the media player when yoyr activity finishes using onDestroy callback:
@Override
public void onDestroy(){
super.onDestroy();
if(mp !=null){
if (mp.isPlaying()){
mp.stop();
}
mp.release();
}
}