Search code examples
androidwebviewwebviewclient

android webViewClient onReceivedError() always getting called even when there is no error


I am loading a url in a WebView, but the WebViewClient method OnReceivedError() always gets called even when the page is loaded successfully. Does anybody have any idea why this is happening?


Solution

  • Should have tried monitoring onReceivedError() method in WebViewClient

    If the page loads fine in the webview, the reason for the onReceivedError() being called is because of the warnings in the HTML/JS script, which you can just ignore, or fix by monitoring the error.