android WebView stop Flash plugin onPause

吃可爱长大的小学妹 提交于 2019-12-01 09:03:07

I ran into the same issue. The following worked for me:

@Override
protected void onDestroy() {
    super.onDestroy();
    final WebView webview = (WebView)findViewById(R.id.webPlayer);
    // Calling .clearView does not stop the flash player must load new data
    webview.loadData("", "text/html", "utf-8");
}

try this.

 public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK && webview.canGoBack()) {
        webview.goBack();
       return true;
    }
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        //webview=null;
        webview.reload();
    }
    return super.onKeyDown(keyCode, event);
   }  

Pavan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!