可以通过MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI上的查询找到播放列表名称
然后查看MediaStore.Audio.PlaylistsColumns.NAME列.
还有一个数据列,MediaStore.Audio.PlaylistsColumns._DATA,但它返回null.
然后查看MediaStore.Audio.PlaylistsColumns.NAME列.
还有一个数据列,MediaStore.Audio.PlaylistsColumns._DATA,但它返回null.
歌曲列表(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI / id)似乎没有显示任何播放列表关联.
解决方法
这是我的程序中的一点:
要点是您需要播放列表的ID来抓取歌曲.
基本上你可以把我的代码和where语句改为.NAME“=’”name“’”,
private Cursor getPlaylists(String playlistId){ Cursor cursor = null; String[] projection1 = { MediaStore.Audio.Playlists._ID,MediaStore.Audio.Playlists.NAME }; cursor = this.managedQuery( MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,projection1,MediaStore.Audio.Playlists._ID+ " = "+playlistId+"",null,null); startManagingCursor(cursor); cursor.moveToFirst(); playlist_id = cursor.getString(0); playlist_id2 = cursor.getLong(0); if(playlist_id2 > 0){ String[] projection = { MediaStore.Audio.Playlists.Members.AUdio_ID,MediaStore.Audio.Playlists.Members.ARTIST,MediaStore.Audio.Playlists.Members.TITLE,MediaStore.Audio.Playlists.Members._ID }; cursor = null; cursor = this.managedQuery( MediaStore.Audio.Playlists.Members.getContentUri("external",playlist_id2 ),projection,MediaStore.Audio.Media.IS_MUSIC +" != 0 ",null); } cManager(cursor,2,1); return cursor; }