如何从播放列表中获取曲目数?

时间:2013-01-26 14:39:53

标签: android audio cursor playlist mediastore

有谁能告诉我如何获得播放列表的成员数量?我尝试了这个,但它不起作用:

int PlayListCount = cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Playlists._COUNT));

它引发了这个异常:

llegalStateException: Couldn't read row 0, col -1 from CursorWindow.
Make sure the Cursor is initialized correctly before accessing data from it.

0 个答案:

没有答案