我正在使用本机Android相机并将文件保存到应用程序数据文件夹(/ mnt / sdcard / Pictures /).同时-在某些设备上-照片的另一个副本将保存到DCIM文件夹中.
这是我的代码:
private void startStockCameraForResult()
{
// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// mediaStorageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
mNextImageFileUri = ImageFileUtils.getOutputMediaFileUri();
intent.putExtra(MediaStore.EXTRA_OUTPUT, mNextImageFileUri); // set the image file name
// start the image capture Intent
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
如何防止在DCIM文件夹中保存图像的其他副本?
我的问题是代码会产生
1张照片:三星Galaxy SIII,华为HUAWEI P2-6011等
2张照片:Samsung Galaxy SI,Htc HTC One XL等
其他线程描述了删除最后添加的图像到DCIM.这里的问题是没有问题的设备,例如DCIM上的Galaxy SIII和Imagename以及应用程序数据文件夹上的Imagename不同.
非常感谢