1. Public Boolean shouldoverrideurlloading (webview view, string URL ){
View. loadurl (URL );
Return true;
}
The request is called only when a link is clicked. If this method is rewritten, true is returned, indicating that the link in the webpage is clicked or redirected in the current webview, rather than in the browser.
2. Public void onreceivedsslerror (webview view, sslerrorhandler handler,
Android.net. http. sslerror error ){
Handler. Proceed ();
}
Rewrite this method to allow webview to process HTTPS requests.
3. Public Boolean shouldoverridekeyevent (webview view, keyevent event ){
Return super. shouldoverridekeyevent (view, event );
}
}
Rewrite this method to handle button 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 );
}
It is called when page resources are loaded, and each resource (slice) is called 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 process
}
Super. onpagestarted (view, URL, favicon );
}
Called when page loading starts.
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.