I am getting result Uri from ACTION_CREATE_DOCUMENT intent.
Since not all formats has mime type I want to set file manually with correct extension.
I'm using DocumentsContract.renameDocument() but this function only work after I write data to the file, what I want is to rename and then write data, but the problem that after this function is called I don't have write permission anymore.
How can I grant permission after DocumentsContract.renameDocument() is called? without extra permissions.
What about using extras to rename the file during the activity result ? Here's how I would do it: