示例#1
0
  protected boolean checkErrorResponse(
      final AsyncTaskPayload payload, BaseResponse response, boolean isShow) {
    if (response instanceof ErrorResponse) {
      if (StringUtils.isEmpty(response.getVerification())) {
        if (response.getResult() != 10047 && response.getResult() != 10) {
          if (isShow && !StringUtils.isEmpty(response.getMsg())) {
            Toast.makeText(mContext.getApplicationContext(), response.getMsg(), Toast.LENGTH_LONG)
                .show();
          }
        }
      }
      payload.setResponse(response);
      Log.e("error:" + response.getResult(), response.getMsg() + "");
      onfailure(payload, response.getMsg());
      return true;
    }
    if (response.getStatus() == 0) {
      onfailure(payload, response.getMsg());
      return true;
    }

    return false;
  }
示例#2
0
 public void handleMessage(android.os.Message msg) {
   if (isActivityRun == false) {
     return;
   }
   switch (msg.what) {
     case 0:
       if (progressDialog == null) {
         progressDialog =
             new CustomDialog(mContext, android.R.style.Theme_Translucent_NoTitleBar);
       }
       String hasProcess = msg.getData().getString("PRO");
       if (StringUtils.isEmpty(hasProcess)) {
         progressDialog.show();
       }
       break;
     case 1:
       if (progressDialog != null && progressDialog.isShowing()) progressDialog.dismiss();
       break;
     default:
       break;
   }
 };