Stop the Music in WebView when Screen Time-Out <p>I am programming that allow users can listen music in WebView via the URL web link. But I wonder why when the android phone user screen Time-Out my music in WebView also stop. Do you have any solution to solve this problem?</p> <h1>Here is my code:</h1> <pre><code>public class PlayMusicActivity extends Activity { WebView mWebView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.playlist); mWebView = (WebView) findViewById(R.id.webView1); mWebView.setWebViewClient(new HelloWebViewClient()); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setPluginsEnabled(true); mWebView.getSettings().setAllowFileAccess(true); mWebView.loadUrl("http://www.myweb.com/music.html"); } private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) { mWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); } @Override public void onPause() { mWebView.setVisibility(View.GONE); mWebView.destroy(); super.onPause(); } } </code></pre> <p>Appreciate for your help.</p> <p>Best regards, Virak</p>