Android WebView: Get the webpage title, androidwebview
Final TextView txtTitle = (TextView) findViewById(R.id.txt Title); final WebView webView = (WebView) findViewById (R. id. btnWebView); WebChromeClient wvcc = new WebChromeClient () {@ Override public void onReceivedTitle (WebView view, String title) {super. onReceivedTitle (view, title); txtTitle. setText ("ReceivedTitle:" + title) ;}; // set the setWebChromeClient object webView. setWebChromeClient (wvcc); // create WebViewCl Ient object WebViewClient wvc = new WebViewClient () {@ Override public boolean shouldOverrideUrlLoading (WebView view, String url) {// use your own WebView component to respond to Url loading events, instead of using the default browser to load the webView page. loadUrl (url); // consume this event. So far, if the Android app returns True, the event will not be passed by bubbling. We call it consumption return true ;}};
WebView. setWebViewClient (wvc );}