我试过这个,但它没有工作
uri=android.provider.MediaStore.Audio.Playlists.Members.getContentUri("external",id);
ContentValues values=new ContentValues();
values.put(MediaStore.Audio.Playlists.Members.IS_MUSIC, 1);
values.put(MediaStore.Audio.Playlists.Members.TITLE,body);
Log.v("song",body);
Log.v("id",""+ID);
values.put(MediaStore.Audio.Playlists.Members.AUDIO_ID,ID);
values.put(MediaStore.Audio.Playlists.Members.PLAYLIST_ID, id);
Log.v("play",""+id);
values.put(MediaStore.Audio.Playlists.Members.PLAY_ORDER,2);
values.put(MediaStore.Audio.Playlists.Members._ID, 7);
values.put(MediaStore.Audio.Playlists.Members.DEFAULT_SORT_ORDER,"play_order");
Uri x=resolver.insert(uri, values);
if(x==null)
{
Log.v("success","unsuccess");
}
else
{
Log.v("success","success");
}
我保留了play_order,因为播放列表中已存在的歌曲的最高值为1。同样地,我放了ID=7
。