【发布时间】:2014-05-12 10:06:46
【问题描述】:
您好,我想将拍摄的照片保存在 SQLite 等所在的应用程序目录中。我不想在 SD 卡中创建任何文件夹和任何隐藏文件。如何将捕获的照片保存在应用程序目录中。
我在下面尝试这个,但它保存在 SD 卡中是隐藏文件,但我不想要这种方法。
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
String capturedPhotoName = "." + System.currentTimeMillis() + ".png";
File photo = new File(Environment.getExternalStorageDirectory(),
capturedPhotoName);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
imageUri = Uri.fromFile(photo);
startActivityForResult(cameraIntent, CAMERA_INTENT_REQUEST);
提前致谢!
【问题讨论】: