I use Android 11, target is:
compileSdkVersion 31
defaultConfig {
applicationId "com.pro.prowh"
minSdkVersion 24
targetSdkVersion 31
versionCode 16
versionName "22.01.12"
}
In the Manifest, I use:
< uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
< uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
MyApp create folder /storage/emulated/0/Documents/PRO_WH/ : OK
If erase PRO_WH folder, by any App, MyApp auto recarete it : OK
MyApp create a file test.txt inside PRO_WH, as /storage/emulated/0/Documents/PRO_WH/test.txt : OK
( this file never create before )
MyApp re-create a file test.txt with new content : OK
MyApp erase file test.txt : OK
MyApp re-create a file test.txt with new content : OK
Issuse:
If erase file test.txt by other app, example use File Manager, MyApp can't create file test.txt again. Error (IOException):
/storage/emulated/0/Documents/PRO_WH/test.txt: open failed: EEXIST (File exists)
file test.txt does not realy exist.
I need help :
How to resolver above isssue ?
or
How to re-create file if the file eraseed by other app ?