android WebView stop Flash plugin onPause

后端 未结 2 1373
灰色年华
灰色年华 2021-01-14 19:10

I have a WebView that contains a html file that contains a Flash plugin (a video).

When the user presses play on the Flash plugin, the video plays fine.

How

相关标签:
2条回答
  • 2021-01-14 19:32

    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");
    }
    
    0 讨论(0)
  • 2021-01-14 19:41

    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

    0 讨论(0)
提交回复
热议问题