I have an application that in the login I download images from my server. in the first login, everything is work fine but when I uninstall the application and install it again I get this exception:
java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.gilapp.android.app/files/images/book_118.png: open failed: EACCES (Permission denied)
and can't save the image.
this happen while I'm trying to create output stream:
OutputStream output = new FileOutputStream(filePath);
The images download fine just when I do the second installation after I go to App info -> Storage -> clear data
Another important point is that it happens only in Samsung's tablet: SM-T800 (API level 23)
In other devices it's not happening, the devices that I test: Samsung SM-G900H (API level 23)
, Asus P028 (API level 24)
, Samsung SM-G950F (API level 28)