Reputation: 102
I have an audio file in the folder path /storage/emulated/legcy/Download/play.mp3 Previously from getExternalStoragePublicDirectory I used to read the song but it doesn't work right now
Upvotes: 0
Views: 382
Reputation: 17340
You should avoid using getExternalStoragePyblicDirectory in Android Q, as such method has been deprecated.
In Android Q new restrictions are applied when accessing media. The recommended way is to use the MediaStore API or Storage Access Framework.
See the next link for more details about scoped storage in Android Q, and how to access files:
https://developer.android.com/training/data-storage/files/external-scoped
Upvotes: 1