Saving PDF from Third Party App Causes Permission Issue – Android Kotlin
I have an app which copies .pdf files from assets and saves them locally. The user can then open the .pdf in a third party app using intents to make annotations and then save the .pdf. Once the user saves the annotated .pdf, I now lose permission to the .pdf. For instance, if they save it in the same location (overwriting original file), I receive EACCES PERMISSION DENIED when trying to reopen it. If the user saves it in a separate directory, I don’t receive an error but it’s as if the file doesn’t exist. When I check to see if the directory exists with .exists(), it returns true but when I run listFiles() on the directory, it returns null.