Android Volley-检查互联网状态

Android Volley-检查互联网状态,第1张

Android Volley-检查互联网状态

没有为该请求引发的NoConnection错误。请捕捉错误

   @Override   public void onErrorResponse(VolleyError volleyError) {   String message = null;   if (volleyError instanceof NetworkError) {         message = "Cannot connect to Internet...Please check your connection!";   } else if (volleyError instanceof ServerError) {         message = "The server could not be found. Please try again after some time!!";   } else if (volleyError instanceof AuthFailureError) {         message = "Cannot connect to Internet...Please check your connection!";   } else if (volleyError instanceof ParseError) {         message = "Parsing error! Please try again after some time!!";   } else if (volleyError instanceof NoConnectionError) {         message = "Cannot connect to Internet...Please check your connection!";   } else if (volleyError instanceof TimeoutError) {         message = "Connection TimeOut! Please check your internet connection.";   }}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5488723.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-12
下一篇2022-12-13

发表评论

登录后才能评论

评论列表(0条)

    保存