0

I want to write a code in kotlin (android11) that opens the internal storage directory so that I can select a pdf file from that directory. But due to restrictions, I can't do this.

Please suggest to me a way to do this. Thanks in advance.

Syed Rafaqat Hussain
  • 1,009
  • 1
  • 9
  • 33
  • 2
    Use the same way as before. You did not try i supose. And for selecting a file you use ACTION_OPEN_DOCUMENT. – blackapps Mar 18 '21 at 07:30
  • 1
    https://stackoverflow.com/questions/62782648/android-11-scoped-storage-permissions – axar Mar 19 '21 at 13:57

1 Answers1

-1
requestLegacyExternalStorage 

is always false in API 30 if

    preserveLegacyExternalStorage

is set then requestLegacyExternalStorage is true (this is a pure migration case and this state won't be preserved should the user uninstall/reinstall the app).

Muhammad Asad
  • 694
  • 6
  • 10