Android WebView shouldInterceptRequest?


Android WebView shouldInterceptRequest?



I need to intercept android requests. I passed an HTTPClient and implemented shouldInterceptRequest.



The doc says



If the return value is null, the WebView will continue to load the resource as usud



But when I return the value of super or return null it breaks and won't load the webview? Any thoughts?


class WebViewClientImpl(val webView: WebView): WebViewClient() {

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? {
retuen null
}
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV