示例#1
0
    @Override
    protected void onPostExecute(BaseWsResponse result) {
      super.onPostExecute(result);
      proDialog.cancel();
      String resultCode = (String) result.getHashMap().get("result");

      if (null != resultCode && resultCode.equalsIgnoreCase("ok")) {
        DialogUtil.displayWarning(
            activity,
            getString(R.string.sys_msg),
            getString(R.string.photo_upload_successful),
            false,
            null);
        previewImage.setImageBitmap(null);
        deleteOldPhotos(photoRealPath);
        saveSinglePoint("", "");
        savePhoto(photoName, "");
      } else {
        DialogUtil.displayWarning(
            activity,
            getString(R.string.sys_msg),
            getString(R.string.photo_upload_fail),
            false,
            new OnClickListener() {
              @Override
              public void onClick(View v) {}
            });
      }
    }
示例#2
0
  @Override
  public void onClick(View v) {
    if (uploadphotoBtn.equals(v)) {

      if (null == getLastPhoto(photoName)) {

        DialogUtil.displayWarning(
            GpsCameraActivity.this,
            getString(R.string.sys_msg),
            getString(R.string.no_photo),
            false,
            new OnClickListener() {
              @Override
              public void onClick(View v) {}
            });
      } else {
        try {
          String photoPath = GlobalInfo.getStringSharedPre(photoName, "");
          File file = new File(photoPath);
          new UploadPhoto(GpsCameraActivity.this, file, upLoadAdd, null).execute();

        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    } else if (cancle.equals(v)) {
      finish();

    } else if (photoBtn.equals(v)) {
      startCamera("", false, "", "", "");
    } else if (delPhotoBtn.equals(v)) {
      previewImage.setImageBitmap(null);
      deleteOldPhotos(photoRealPath);
      savePhoto(photoName, "");
    }
  }