In the Android SDK 23 onReceivedError(WebView view, int errorCode, String description, String failingUrl)
has been deprecated and replaced with onReceivedError(WebView view, WebResourceRequest request, WebResourceError error)
. However if I put my phone in Airplane mode and load an url on my WebView, only the deprecated version of the method is called.
onReceivedHttpError (WebView view, WebResourceRequest request, WebResourceResponse errorResponse)
is also not useful, as it only detects errors higher than 500, and I am getting a 109 status code.
Is there a non-deprecated way of detecting that my WebView failed to load?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…