예제 #1
0
  /** 拍照取图 */
  public void takePhoto() {
    String savePath = FDBitmap.savePath;
    // 判断是否挂载了SD卡
    String storageState = Environment.getExternalStorageState();
    if (storageState.equals(Environment.MEDIA_MOUNTED)) {
      File savedir = new File(savePath);
      if (!savedir.exists()) {
        savedir.mkdirs();
      }
    }

    // 没有挂载SD卡,无法保存文件
    if (StringUtils.isEmpty(savePath)) {
      FDViewUtil.showToast(context, "无法保存照片,请检查SD卡是否挂载");
      return;
    }

    imageFile = FDBitmap.getLocalTimeStampFile();
    Uri uri = Uri.fromFile(imageFile);

    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
    activity.startActivityForResult(intent, FD_COMMON_TAKE_PICTURE);
  }
 /**
  * 更新列表状态
  *
  * @param count
  */
 private void onCommentLoad(long count) {
   noteCommentListView.setCount("" + count);
   noteCommentListView.stopRefresh();
   noteCommentListView.stopLoadMore(pageNo > totalPage);
   noteCommentListView.setRefreshTime(StringUtils.dateToString(new Date()));
 }