I have an app that I\'ve put together to stream flash video in a webview when a user clicks a button.
It does this fine, but after backing out or losing focus, it lo
If you are as lucky as I am, even this won't be enough to end a youtube streaming! The sound is still playing no matter what!
@Override
protected void onDestroy() {
super.onDestroy();
// Stopping a webview and all of the background processes (flash,
// javascript, etc) is a very big mess.
// The following steps are to counter most of the issues seen on
// internals still going on after the webview is destroyed.
mWebView.stopLoading();
mWebView.loadData("", "text/html", "utf-8");
mWebView.reload();
mWebView.setWebChromeClient(null);
mWebView.setWebViewClient(null);
RelativeLayout layout = (RelativeLayout) findViewById(R.id.webviewRelativeLayout);
layout.removeView(mWebView);
mWebView.removeAllViews();
mWebView.clearHistory();
mWebView.destroy();
mWebView = null;
}