Android: How to get a content:// URI for a file in the external storage PUBLIC directory
问题 I've followed this Google tutorial to start an intent to capture an image with new Intent(MediaStore.ACTION_IMAGE_CAPTURE) . The tutorial recommends using the public directory with getExternalStoragePublicDirectory which would work great for my app. But then their example instead uses getExternalFilesDir . Then to pass the URI of the file to the intent with MediaStore.EXTRA_OUTPUT I have to get a content URI because I'd like to target Android N. Before targeting N I would just pass a file://