I am trying to save an image captured using an Android camera in a normal place. My code is as follows:
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);
The image is saved in the right place, but it is also saved in the default camera folder, which causes it to be displayed in the gallery. Any suggestions?
source
share