• 团队冲刺第二阶段09


    做好了拍照的功能,增加了上传录制摄的功能。

    部分代码:

    private void takePhoto () {
        // Checks for camera app available
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        if (!IntentChecker.isAvailable(mainActivity, intent, new String[]{PackageManager.FEATURE_CAMERA})) {
          mainActivity.showMessage(R.string.feature_not_available_on_this_device, ONStyle.ALERT);
    
          return;
        }
        // Checks for created file validity
        File f = StorageHelper.createNewAttachmentFile(mainActivity, MIME_TYPE_IMAGE_EXT);
        if (f == null) {
          mainActivity.showMessage(R.string.error, ONStyle.ALERT);
          return;
        }
        attachmentUri = FileProviderHelper.getFileProvider(f);
        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, attachmentUri);
        startActivityForResult(intent, TAKE_PHOTO);
      }
    private void takeVideo () {
    Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
    if (!IntentChecker.isAvailable(mainActivity, takeVideoIntent, new String[]{PackageManager.FEATURE_CAMERA})) {
    mainActivity.showMessage(R.string.feature_not_available_on_this_device, ONStyle.ALERT);

    return;
    }
     
  • 相关阅读:
    quick cocos naja
    quick cocos sprite 3 zhongfangshi
    quick cocos moveto
    quick cocos animate2
    quick cocos animate
    quick cocos schedule
    quick cocos scheduler update
    【leetcode】括号的最大嵌套深度
    【leetcode】删除某些元素后的数组均值
    【leetcode】二叉树的最小深度
  • 原文地址:https://www.cnblogs.com/xjmm/p/13085456.html
Copyright © 2020-2023  润新知