I am in a situation where I have an ActivityGroup and inside of which I have an Activity in which I have used MediaPlayer to play an audio file. But when I navigate out of that Activity I am trying to stop the MediaPlayer, but unfortunately I was not able to do it. So I tried finishing my activity when I navigate out of it. I am able to finish the activity but still MediaPlayer doesn't stop at all.
How should I solve this.
MediaPlayer won't stop when you finish your activity, you need to explicitly call
mMediaPlayer.stop() in your activity's