Android使用相机demo

    private void saveFullImage(String str) {
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        // 文件夹aaaa
        File path1 = new File(path + floerName);
        if (!path1.exists()) {
            path1.mkdirs();
        }
        File file = new File(path1, str + ".jpg");
        mOutPutFileUri = Uri.fromFile(file);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, mOutPutFileUri);
        startActivity(intent);
        Toast.makeText(getApplicationContext(), str+" 照片已经替换", 0).show();

    }

配置清单文件添加权限(str是保存 相机照片的名字)

原文地址:https://www.cnblogs.com/spadd/p/4429203.html