I am trying to fix a problem after the new feature added in Android file system but I get this error:
android.os.FileUriExposedException: file:///storage/emu
No required provider configuration into AndroidManifest only Camera and Storage permission should be permitted. Use the following code to start the camera:
final int REQUEST_ACTION_CAMERA = 9;
void openCamra() {
Intent cameraImgIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraImgIntent.putExtra(MediaStore.EXTRA_OUTPUT,
FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID +".provider",
new File("your_file_name_with_dir")));
startActivityForResult(cameraImgIntent, REQUEST_ACTION_CAMERA);
}
After capturing the image, you can find your captured image in:
"your_file_name_with_dir"