我正在尝试将通过 android 相机捕获的图像保存在自定义位置。我的代码如下所示:
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
File f = File(android.os.Environment.getExternalStorageDirectory(), "test.jpg");
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(f));
startActivityForResult(intent, SUB_ACTIVITY_CAMERA_PREVIEW);
图像被保存到所需位置,但它也被保存到默认相机文件夹中,这导致它显示在图库中。有什么建议么?