如何显示Android webview加载对话框

时间:2012-08-12 13:13:54

标签: android

我正在尝试在我的webview应用程序中实现一个加载对话框,但无论我做什么它都行不通....这是我的代码

公共类AlTibbiWebViewActivity扩展了Activity {

private WebView wv;
private Intent incomingIntent = null;
private WebViewClient wvc = new WebViewClient() {

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        wv.loadUrl(url);
        return true;
    }

};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.web_view);
    this.wv = (WebView) findViewById(R.id.webView);
    this.wv.setWebViewClient(wvc);
    wv.getSettings().setJavaScriptEnabled(true);
    this.incomingIntent = getIntent();
    String urlToLoad = incomingIntent.getExtras().getString("urlToLoad");
    wv.loadUrl(urlToLoad);

}

0 个答案:

没有答案