I have an app that needs to write files to external storage. In manifest I've added
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
In the activity I am calling
ActivityCompat.requestPermissions(this, STORAGE_PERMISSIONS, PERMISSION_REQUEST_RW_EXTERNAL_STORAGE);
Where:
private static final int PERMISSION_REQUEST_RW_EXTERNAL_STORAGE = 783;
private static final String[] STORAGE_PERMISSIONS = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE};
Of course I'm granting everything and I can see in "onRequestPermissionsResult" the grants received by the app. After all of that, when trying to create a file in external storage I am getting permissions denied.
java.io.IOException: Permission denied
Running on:
Android 8 (Oreo)
compileSdkVersion 27
minSdkVersion 23
targetSdkVersion 27
EDIT: I am trying to write this directory: /storage/emulated/0/6666-6433/DCIM/Camera/. In previous state I'm listing video files on local storage and getting files in this directory. reading the files using this path is working as expected.