-1

I want to choose pdf file from Downloads folder and send it to chat. But this document is not loaded. When I use Android 9, it works ok. I am confused that when I receive uri, I have this value: content://0@media/external/file/ . what is 0@media?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Monica
  • 384
  • 2
  • 4
  • 16

1 Answers1

3

On Android 11, apps can no longer access files in any other app's dedicated, app-specific directory within external storage. To protect user privacy, on devices that run Android 11 or higher, the system further restricts your app's access to other apps' private directories.

You have to use Storage Access Framework to access external storage in android 10+

You can use ACTION_OPEN_DOCUMENT intent, which opens the system's file picker app.

Have a look : Open a file

DrHowdyDoo
  • 2,327
  • 2
  • 7
  • 21