I have an android app that creates a file on external storage (e.g. an sd card). It can read and write the file perfectly as long as the Android OS is not restarted. After a restart, with the same android.net.Uri
, used before to access the file, the app no longer can open the file to write in it.
The app has both READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions and gets a stream of the file using context.getContentResolver().openOutputStream(uri))
to write in it. but it fails after an android restart.
I have tested the app on two android phones and this happens in both.
How can I solve this problem?