xutils拦截响应,下面是我手写出来的,供大家参考。
public void onError(Throwable ex,boolean isOnCallback){
if(ex instanceof HttpException){//网络错误
HttpException httpEx=(HttpException)ex;
int responseCode=httpEx.getCode();
String responseMsg=httpEx.getMessage();
String errorResult=httpEx.getResult();
}else{//其它错误
}
}