How to get loaded web page title in Android WebView?

前端 未结 7 660
我在风中等你
我在风中等你 2020-12-01 02:00

I\'m using a WebView in my application, I have a requirement to change the app title based on the page user is on. How can I do this in Android WebView?

I did this i

相关标签:
7条回答
  • 2020-12-01 02:45

    Simplest way to read title of page in Kotlin :

          webView.webViewClient = object : WebViewClient() {
             //....
              override fun onPageFinished(view: WebView, url: String) {
               val title = view.title
                }
               //...
              }
    
    0 讨论(0)
提交回复
热议问题