1

我想改变音乐路径。我有离线音乐播放器。音乐播放器读取 SdCard 但我想更改音乐路径并使用原始文件夹。谢谢

public void getMusic() {
    Uri songUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
    Cursor songCursor = contentResolver.query(songUri, null, null, null, null);
    if (songCursor != null && songCursor.moveToFirst()) {
        int songTitle = songCursor.getColumnIndex(MediaStore.Audio.Media.TITLE);
        int songArtist = songCursor.getColumnIndex(MediaStore.Audio.Media.ARTIST);
        int songPath = songCursor.getColumnIndex(MediaStore.Audio.Media.DATA);

        do {
            songsList.add(new SongsList(songCursor.getString(songTitle), songCursor.getString(songArtist), songCursor.getString(songPath)));
        } while (songCursor.moveToNext());
        songCursor.close();
    }
}
4

0 回答 0