取消加载webview中的视频[中间]不起作用

时间:2012-07-09 05:31:11

标签: android youtube android-webview

加载YouTube视频时,

webView.stopLoading不起作用。

 public void onCreate(Bundle b)
{

            WebView webView=(WebView) findViewById(R.id.sssWebView);
            webview.setWebViewClient(new WebViewClient());
            WebSettings webSettings = webReview.getSettings();
            webSettings.setJavaScriptEnabled(true);
            webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
            webSettings.setPluginState(PluginState.ON);
            webSettings.setSupportMultipleWindows(false);
            webSettings.setSupportZoom(false);
            webview.setVerticalScrollBarEnabled(false);
            webview.setHorizontalScrollBarEnabled(false);

            webview.loadUrl("http://www.youtube.com/v/" + videoID);

}

@Override
        public void onBackPressed()
        {
        if(progreesDialogue!=null && progreesDialogue.isShowing())
        {

            progreesDialogue.dismiss();


        }


        webview.clearView();        
        webview.stopLoading();       
        this.finish();        
        super.onBackPressed();

        }

0 个答案:

没有答案