I have created two activities say A and B. Activity A lists list of songs. When we press in any of these songs, the activty B will be called by using startActivity(). Now the activity B will start one thread to create and start mediaplayer with selected song and also show song progress. Everything works fine if we press the back button in activity B,obviously, we will come to activity A and the media player never stops the playing, this is also fine. My problem is after pressing the back button if we select another song,the activity B will be called, then another instance of media player object will be created instead of stopping previously running media player object..So anyone just tell me how can i stop that media player object???
Thanks in advance
I have created two activities say A and B. Activity A lists list of
Share
Give this a try :
you can release the previously captured media player object in onStop method of Activity B.
While pressing back button this will released the media player object.