简体   繁体   English

如何在自定义对话框内的 webview 上添加完成加载的网页?

[英]How to add on webpage finished loading on a webview inside a custom dialog?

Im successfully add webview inside of my custom dialog I want to display toast after the webview finished loading how to add it ?我成功地在我的自定义对话框中添加了 webview 我想在 webview 加载完成后显示 toast 如何添加它? (it seem theres no need for my code to show) (似乎我的代码不需要显示)

here's some code that illustrates how to track page loading witha WebView:下面是一些说明如何使用 WebView 跟踪页面加载的代码:

        webView = rootView.findViewById<WebView>(R.id.webView).apply {

            webViewClient = object : WebViewClient() {
                override fun onPageFinished(view: WebView?, url: String?) {
                    loadingView.visibility = View.GONE

                    super.onPageFinished(view, url)
                }

                override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
                    loadingView.visibility = View.VISIBLE
                }
            }
        }.also {
            it.loadUrl(url)
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM