In Android 10 apps that need to access storage need to ask permission to access a concrete path. But apps like file explorer can ask permission for access to the root storag
in Android Q If you giving permission and its granted or not working so go to Manifest and add
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true" //Add this Line
android:label="@string/app_name">
---------<Activity, Sevices or Recivers>----------
</application>
you must add this line in your AndroidManifest.xml
android:requestLegacyExternalStorage="true"
The problem was that I use File object to access files, but permission only work if we use DocumentFile object to manipulate files.
Solved using DocumentFile instead of File.
It has multiple negative points to use DocumentFile, such as performance and that you don't have access to apache commons libraries for example, but there is no other option.