Android Change Music folder path From Sd Card to Raw File

103 views Asked by At

i want to change music path . i have offline music player. Music player read SdCard but i want change music path and using raw folder. Thank you

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();
    }
}
0

There are 0 answers