|
@@ -1218,7 +1218,15 @@ public class HtmlActivity extends BaseActivity<ActivityHtml1Binding> implements
|
|
|
@Override
|
|
|
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
|
|
|
super.onReceivedError(view, request, error);
|
|
|
- showLoadErrorView();
|
|
|
+ if (error != null) {
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
|
+ LOG.i("onReceivedError:" + error.getErrorCode());
|
|
|
+ LOG.i("onReceivedError:" + error.getDescription());
|
|
|
+ if (error.getErrorCode() == WebViewClient.ERROR_HOST_LOOKUP || error.getErrorCode() == WebViewClient.ERROR_CONNECT) {
|
|
|
+ showLoadErrorView();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|