"Android" only allows the webview of the application to load Web pages without invoking an external browser

Source: Internet
Author: User


The only way to get the webview of this application to load a Web page without calling an external browser is to set webviewclient and override Webviewclient's Shouldoverrideurlloading method to return True

Mwebview.setwebviewclient (New Webviewclient () {@Overridepublic Boolean shouldoverrideurlloading (WebView view, String URL) {//TODO auto-generated method Stubview.loadurl (URL); return true;}});




Cause: The default implementation of the Shouldoverrideurlloading method for Webviewclient is to return false directly:

    /** 。。。。。。。     * @param view the WebView is initiating the callback.     * @param url The URL to is loaded.     * @return True If the host application wants to leave the current WebView     *         and handle the URL itself, otherwise r Eturn false.     *    /public boolean shouldoverrideurlloading (WebView view, String URL) {        return false;    }


"Android" only allows the webview of the application to load Web pages without invoking an external browser

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.