How to resume activity with audio in Android?
I have implemented media player. I have only one Activity. When I'm starting the activity, my music starts to play and when I press the back button the music clip is in pause state, and again when I resume my activity, the music resumes properly. But there is error after I try to resume my Application after song got over. The app crashed, and I'm getting exception for IllegalStateException in back-press method( mp.pause(); ). Please have a look at below code and suggest if I am doing something wrong. public class Audio_Activity extends Activity { private MediaPlayer mp; Button btnStartStop ;