Exemplo n.º 1
0
 @Override
 public void onSuccess(ResponseInfo<String> responseInfo) {
   LogUtil.e(TAG, mUrl + " 返回:" + responseInfo.result);
   DMSResponse response = null;
   try {
     // TODO:第一次连接360免费wifi会返回html
     response = JSONObject.parseObject(responseInfo.result, DMSResponse.class);
     onResult(response);
   } catch (Exception e) {
     LogUtil.e(TAG, mUrl + " " + e.getMessage());
     onResult(
         new DMSResponse(
             String.valueOf(Api.RESULT_CODE_JSONFAIL), mContext.getString(R.string.net_error)));
     return;
   }
 }
Exemplo n.º 2
0
 @Override
 public void onFailure(HttpException error, String msg) {
   LogUtil.e(TAG, mUrl + " " + "msg: " + msg + "error:" + error.getMessage());
   onResult(
       new DMSResponse(
           String.valueOf(Api.RESULT_CODE_NETFAIL),
           mContext.getString(R.string.net_error_tips)));
 }