Add TakePersistableUriPermission
Mike134 opened this issue · comments
Mike Nichols commented
Would like for the FilePicker in Android to persist permissions after a file has been successfully selected.
I'm wondering if in FilePickerActivity.android.cs, in OnActivityResult at around line 153 adding something similar to the following would do the trick.
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat)
{
context.ContentResolver.TakePersistableUriPermission(uUri, ActivityFlags.GrantWriteUriPermission | ActivityFlags.GrantReadUriPermission);
}
vividos commented
I tried to put this in the FilePicker, but calling TakePersistableUriPermission() throws a SecurityException
...
vividos commented
vividos commented
calling TakePersistableUriPermisssion is now in since some time. I'm closing this issue.