In my Music-Player, a Playlist may contain two identical songs (the user adds the same song two times).
Let's say the song which is 2 times in the Playlist has the id 7664.
When removing this song from the Playlist, ContentResolver.delete(URI_OF_PLAYLIST, "audio_id=7664", null);
removes both matches.
So how do I only delete one match?
Thanks in advance!
This is how I do it in my app New Playlist Manager:
step 1: create an array with audio Ids
step 2: whilst looping around this, use the .lastindex() function to determine if it exists elsewhere. (otherwise the value should be the same as position)
step 3: if found, remove from audio Ids array by setting it to null (you do not want to change its size) and remove from playlist
step 4: reorder the playorder