请问kerkee解决了 onReceivedError 不能捕获 http errors 的问题么

android onReceivedError方法捕获的是 文件找不到,网络连不上,服务器找不到等问题,并不能捕获 http errors。
已邀请:

zihong

赞同来自:

在kerkee的网络请求统一实现在XHR中,而webview中的onReceivedError这个接口本身只是页面级的错误回调,若要监听页面中网络的回调,后续我可以把XHR的网络状态回调给上层

筱龙缘

赞同来自:

mWebview.loadUrlExt("http://localhost/xxxxxxx";);
 
如果说404 onReceivedError 接收不到回调

zihong

赞同来自:

参考一下它的接口说明,你试试换成常规的URL
      Report web resource loading error to the host application. These errors usually indicate
inability to connect to the server. Note that unlike the deprecated version of the callback,
the new version will be called for any resource (iframe, image, etc), not just for the main
page. Thus, it is recommended to perform minimum required work in this callback.

要回复问题请先登录注册