WebView Loadurl () popup System Browser workaround

Source: Internet
Author: User

There are times when the site that we are requesting will go directly to a location, which will either load the page that is being redirected to the full screen browser, or pop up the browser selection (in addition to the system, you have installed your own other browser).

So the solution to the principle is to jump in the webview.

Method One:

Mywebview.setwebviewclient (New Webviewclient () {

public boolean shouldoverrideurlloading (WebView view, String URL)

{

Override this method to indicate that clicking the link inside the page

Or in the current WebView jump, do not jump to the browser side

View.loadurl (URL);

return true;

}

}

Method Two:

Private class Diywebviewclient Extends webviewclient

{

public boolean shouldoverrideurlloading (WebView view,string URL)

{

View.loadurl (URL);

return true;

}

}

Mywebview.setwebviewclient (New Diywebviewclient ());

Reproduced
http://blog.csdn.net/lieri111/article/details/8213069

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.