Tuesday, 25 August 2015

android webview shouldOverrideUrlLoading


This is the link of the api of this function:

http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String)


if you want to change the url you can get the url and change it even to "http://baiduhix.blogspot.co.uk/", but you must return "true" and call webview.loadUrl(theNewURL) manually.

Call webview.loadUrl(xxx) in "shouldOverrideUrlLoading" will not cause infinite loop.

Note: Change the url but return false, will not apply the url changing.

http://stackoverflow.com/questions/6738328/shouldoverrideurlloading-in-webview-for-android-not-running








No comments:

Post a comment