I\'m trying to query playlists in the device from MediaStore. I have followed a question asked before but I didn\'t get the answer.
This is how I query for playlist
Example to populate an array :
Cursor cursor = plist.getPlaylistTracks(getActivity(), playlist_id);
// replace with your own method to get cursor
ArrayList audio_ids = new ArrayList();
// build up the array with audio_id's
int i = 0;
if (cursor != null && cursor.moveToFirst()) {
for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
String audio_id = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Playlists.Members.AUDIO_ID));
audio_ids.add(audio_id);
}
Make sure that when you assign audio_id (or your own variable) you use the correct MediaStore uri as used when you obtained the cursor. The column names in your cursor determine what you can get here.