What I want: Copy a file from GoogleDrive folder to my apps folder, modify the file and after this copy back the file to the original place.
What I do at the moment: I use the Storage Access Framework (SAF) file picker to select the file in GoogleDrive. As result I got a DocumentFile which I can copy to the internal place of my app. I store the Uri of the file for later use
How to write back the file to the original place?
What I did
I there another way to do this? Thx and br Klaus
When you get the URI returned from ACTION_OPEN_DOCUMENT, call context.getContentResolver().takePersistableUriPermission(uri,Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
Then later you will be able to use the URI to write the document using ContentResolver.openOutputStream(uri).