Android ProgessBar while loading WebView

后端 未结 12 2607
闹比i
闹比i 2020-12-08 01:52

In my application, I have a WebView which loads any URL from the internet. Now, sometimes due to slow networks the page takes a long time to load and the user s

12条回答
  •  没有蜡笔的小新
    2020-12-08 02:44

        myThanh.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    
        final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
    
        progressBar = ProgressDialog.show(MainActivity.this,"Đang tải dữ liệu",  "Vui lòng chờ...");
    
        myThanh.setWebViewClient(new WebViewClient() {
    
    
            public void onPageFinished(WebView view, String url) {
                if (progressBar.isShowing()) {
                    progressBar.dismiss();
                }
            }
        });
    

提交回复
热议问题