Android WebView: Get the webpage title, androidwebview

Source: Internet
Author: User

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 );}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.