Q:

Music in Webview Activity kill when press back button to home activity

I am coding the play mp3(Flash Embedded) in WebView(Second Activity), I can play the music in WebView as usually, but when I press back buttom to First Activity the music in Second Activity in WebView still playing, then I go to Second Activity again in WebView to stop the music but it's appear the new mp3 play list screen, I can't stop the music.
So, how can I kill the process when I press back button to First Activity(Home Screen)
Best Regards,
Virak

A:

write this function in your class. actually this will override onpause.
@Override
protected void onPause() {
    super.onPause();
    finish();
}

