如何在webview中隐藏页面加载过程,而控件是在android中的onpagestarted()里面?

时间:2014-09-09 15:19:01

标签: android webview

我不想在webview中显示页面加载过程,而控件在onpagestarted()android中。我想要的是,在下载完整页面时显示Web视图中的内容。我正在使用的代码是`

    web.setWebViewClient(new myWebClient());
    web.getSettings().setJavaScriptEnabled(true);

    web.loadUrl("http://iba.edu.pk/");

和`WebViewClient类如下

public class myWebClient extends WebViewClient
{
    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        // TODO Auto-generated method stub
        //web.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ONLY);

        Log.d("Main"," onPageStarted");
        super.onPageStarted(view, url, favicon);

    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        // TODO Auto-generated method stub
        Log.d("Main"," shouldOverrideUrlLoading");
        view.loadUrl(url);

        return true;

    }

    @Override
    public void onPageFinished(WebView view, String url) {
        // TODO Auto-generated method stub
        super.onPageFinished(view, url);
        Log.d("Main"," on Page finsihed");

        progressBar.setVisibility(View.GONE);
    }
}

0 个答案:

没有答案