How to play mp3 files from internal and external SD card in android?

后端 未结 5 1770
鱼传尺愫
鱼传尺愫 2021-02-10 02:31

I am working on a mp3 player app, which plays .mp3 files present anywhere inside an internal SD card.

I have used the following codes to fetch the .mp3 files present in

5条回答
  •  Happy的楠姐
    2021-02-10 03:00

    Trying using this:

    File root = Environment.getExternalStorageDirectory();
    

    That will get you the root of the external storage, provided that there is one. Then you can filter out files that aren't .mp3

    Also consider looking at this: List all of one file type on Android device?

提交回复
热议问题