Saving photos and videos using Android FileProvider to the gallery
问题 My application (using SDK less than 24) can take photos and video using the camera. The photos and videos can be viewed in the gallery outside the app. SDK 24 and above requires FileProvider to create the uri for saving the photo or video to the gallery. Prior to SDK 24 I would use a uri and an intent to take a photo: private void openCameraForResult(int requestCode){ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); picturesDirectoryPhotoFileName = nextFileName(); File photoFile =