Exemplo n.º 1
0
  /** 更新资料编辑 */
  protected void updateInfoData() {
    getUserData();
    // 添加要上传的图片
    // addUploadImages();

    // 判断用户是否修改了资料
    if (mNewUserBean.equals(mOldUserBean) && Bimp.imgPath.size() == 0) {
      showLongToast(getString(R.string.eidt_info_tip_msg));
      return;
    }
    // 设置用户操作的动作码
    PreferencesUtil.setSteps(Constants.Step.SAVE);
    mNewUserBean.imgList = Bimp.getUploadImg();
    // 提交编辑请求
    // AsyncHttpService.modifyUserInfo(mNewUserBean, imgList,
    AsyncHttpService.modifyUserInfo(
        mNewUserBean,
        new JsonHttpResponseHandler() {

          @Override
          public void onStart() {
            showLoadDialog((R.string.is_submitted_ellipsis));
            super.onStart();
          }

          @Override
          public void onFailure(
              int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
            super.onFailure(statusCode, headers, throwable, errorResponse);
            showLongToast(getString(R.string.httpisNull));
            mDialogLoading.dismiss();
          }

          @Override
          public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
            Log.d(TAG, "info: " + response.toString());
            dismissLoadDialog();
            super.onSuccess(statusCode, headers, response);
            try {
              if (UtilsError.isErrorCode(EditInfoActivity.this, response)) {
                return;
              }

              PreferencesUtil.putValue(PreferencesUtil.KEY_USER_NAME, mNewUserBean.userName);
              showLongToast(R.string.data_editor_success);
              thisFinish();

            } catch (Exception e) {
              dismissLoadDialog();
              e.printStackTrace();
              ErrLogUtils.uploadErrLog(EditInfoActivity.this, ErrLogUtils.toString(e));
            }
          }
        },
        this);
  }
Exemplo n.º 2
0
 @Override
 public void onDestroy() {
   Bimp.clearCache();
   super.onDestroy();
   // ActivityStackManager.getStackManager().popActivity(this);
 }
Exemplo n.º 3
0
 private void thisFinish() {
   Bimp.clearCache();
   setResult(RESUULT_CODE_EDIT_INFO);
   finish();
 }