Should Override Url Loading Event
Give the host application a chance to take control when a URL is about to be loaded in the current WebView. If a WebViewClient is not provided, by default WebView will ask Activity Manager to choose the proper handler for the URL. If a WebViewClient is provided, returning true
causes the current WebView to abort loading the URL, while returning false
causes the WebView to continue loading the URL as usual.
Note: Do not call WebView.loadUrl with the request's URL and then return true
. This unnecessarily cancels the current load and starts a new load with the same URL. The correct way to continue loading a given URL is to simply return false
, without calling WebView.loadUrl.
Note: This method is not called for POST requests.
Note: This method may be called for subframes and with non-HTTP(S) schemes; calling WebView.loadUrl with such a URL will fail.