Webview 中的进度对话框
简单地说,每次在我的 webview
中单击新链接时,如何才能显示进度对话框。我尝试了很多教程和方法,但每个教程和方法都只在应用程序最初加载时显示一次对话框。
这是我的代码
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
ProgressDialog dialog = ProgressDialog.show(myActivity.this, "",
"Loading. Please wait...", true);
@Override
public void onPageFinished(WebView view, String url) {
dialog.dismiss();
}
Simply put how can I make a progress dialog show up every time a new link is clicked in my webview
. I have tried many tutorials and methods but every one of them only shows the dialog once, when the app is initially loaded.
Here is my code
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
ProgressDialog dialog = ProgressDialog.show(myActivity.this, "",
"Loading. Please wait...", true);
@Override
public void onPageFinished(WebView view, String url) {
dialog.dismiss();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试这个最简单的,它对我有用
Try this easiest one,it work for me
看看这个:
check out this:
试试这个,
如果你想做出自己的进度对话框,然后
让我知道会发生什么..
Try this,
And if you want to make your own progressDialog then
And let me know what happen..