Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to query for songs in playlists on Android SDK?

So my question is how to query for playlist content. I can make a query to display all the playlists, but how to make a query to display songs in a specific playlist.

Thanks

like image 626
v66dik Avatar asked Oct 14 '11 13:10

v66dik


1 Answers

Okay, so I have manged to put the code together myself. So this is it :

 String[] proj = {   MediaStore.Audio.Playlists.Members.AUDIO_ID,
                    MediaStore.Audio.Playlists.Members.ARTIST,
                    MediaStore.Audio.Playlists.Members.TITLE,
                     MediaStore.Audio.Playlists.Members._ID
                    };

            c = getContentResolver().query(   MediaStore.Audio.Playlists.Members.getContentUri("external",playlistID),
                    proj,
                    null,
                    null,
                    null);
            startManagingCursor(c);
like image 77
v66dik Avatar answered Sep 23 '22 13:09

v66dik