How to listen for a WebView finishing loading a URL?

前端 未结 17 754
予麋鹿
予麋鹿 2020-11-22 05:40

I have a WebView that is loading a page from the Internet. I want to show a ProgressBar until the loading is complete.

How do I listen for

17条回答
  •  一向
    一向 (楼主)
    2020-11-22 06:26

    for Kotlin users:

    webView.webViewClient = object : WebViewClient() {
                override fun onPageFinished(view: WebView?, url: String?) {
                    // do your logic
                }
            }
    

    there are a lot of methods that you can override though

提交回复
热议问题