I need to let the user take a picture (from the gallery or from a camera app) with Android 6.0.
Because I don\'t need to control the camera, I wanted to use an intent as
Try this:
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(getActivity().getApplicationContext().getExternalFilesDir(android.os.Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + "yourPicture.jpg");
Uri uri = Uri.fromFile(file);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, url);
This gives you access to an "external" storage writable for camera apps in this case, but the files are just visible from your app. To learn a little bit more about storage spaces in android see https://www.youtube.com/watch?v=C28pvd2plBA
Hope it helps you!