An explanation of how Android webviewclient

Source: Internet
Author: User

1. Public Boolean shouldoverrideurlloading (WebView view, String URL) {
View.loadurl (URL);
return true;
}
The click Request is a link is only called, overriding this method returns true to indicate that clicking on the link in the page or in the current WebView jump, do not jump to the browser side.
2. public void Onreceivedsslerror (WebView view, Sslerrorhandler handler, android.net.http.SslError error) {
Handler.proceed ();
}
Overriding this method allows WebView to handle HTTPS requests.
3. Public Boolean shouldoverridekeyevent (WebView view, KeyEvent event) {
Return super.shouldoverridekeyevent (view, event);
}
}
Override this method to handle key events in the browser.
4. public void Onloadresource (WebView view, String URL) {
TODO auto-generated Method Stub
if (DEBUG) {
LOG.D (TAG, "Onloadresource");
}
Super.onloadresource (view, URL);
}
Called when a page resource is loaded, and each resource (a slice) is loaded once.
5. public void onpagestarted (WebView view, String URL, Bitmap favicon) {
TODO auto-generated Method Stub
if (DEBUG) {
LOG.D (TAG, "onpagestarted");
}
if (Url.endswith (". apk")) {
Download (URL);//Download processing
}
super.onpagestarted (view, URL, favicon);
}
Called when a page load is started.
6. public void onpagefinished (WebView view, String URL) {
TODO auto-generated Method Stub
if (DEBUG) {
LOG.D (TAG, "onpagefinished");
}
super.onpagefinished (view, URL);
}
Called at the end of page loading.

An explanation of how Android webviewclient

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.