Android Q (10) ask permission to get access all storage. Scoped storage Android Q (10) ask permission to get access all storage. Scoped storage android android

Android Q (10) ask permission to get access all storage. Scoped storage


Add line in Manifest

<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.