I got a song id from a playlist in MediaStore, using
long id = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Playlists.Members.AUDIO_ID));
and the id is correct, but as the only other data available is CONTENT_DIRECTORY, DEFAULT_SORT_ORDER, PLAYLIST_ID, PLAY_ORDER, and _ID, I am not sure how to get the important parts of the song. I need the title, album, artist, etc., as if I was going through MediaStore.Audio.Media to get Song info.
I found an answer that I tried to modify to fit my needs, but I don't really understand querying or cursors, I am not sure how if there is a way to get a song.
If the only way to do this is to cycle through every single song until i find a matching ID i can do that, but it is wildly inefficient and there has to be a better way.
Thanks in advance!
I was able to query a song by ID using the following code:
You can query for different things by changing the selection and selectionArgs. Here is the documentation from the query function: