My app use camera to take a photo and use it for long term.
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri resultUri = null;
resultUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
new ContentValues());
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, resultUri);
startActivityForResult(imageCaptureIntent, IMAGE_CAPTURE_REQUEST_CODE);
But when I call takePersistableUriPermission(), I will get SecurityException: No persistable permission grants found
I've read this Getting Permission Denial Exception. It works perfect to ACTION_OPEN_DOCUMENT. How do I get a persistent permission from Camera?