这是适用于播放列表的代码:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setComponent(new ComponentName
("com.android.music","com.android.music.PlaylistBrowserActivity"));
intent.setType(MediaStore.Audio.Playlists.CONTENT_TYPE);
intent.setFlags(0x10000000);
intent.putExtra("oneshot", false);
intent.putExtra("playlist", playlistid);
startActivity(intent);
并检索播放列表 ID:
Cursor cursor = getContentResolver().query
(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, null, null, null,
null);
if (cursor != null) {
if (cursor.moveToFirst()) {
do {
playlistid = cursor.getString(cursor.getColumnIndex
(MediaStore.Audio.Playlists._ID));
playList.add(playlist);
} while (cursor.moveToNext());
cursor.close();
}
}
(复制自http://www.androiddiscuss.com/1-android-discuss/29092.html)