[android]代码库
ContentResolver mResolver = getContentResolver();
Cursor cursor = mResolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
int i = 0;
int cursorCount = cursor.getCount();
if (cursorCount >0 )
{
cursor.moveToFirst();
while (i < cursorCount)
{
//歌曲文件的路径 :MediaStore.Audio.Media.DATA
url = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA));
if(url.toLowerCase().indexOf("指定的歌曲路径") > 0)
{
......
}
i++;
cursor.moveToNext();
}
cursor.close();
}
by: 发表于:2018-01-02 10:00:52 顶(0) | 踩(0) 回复
??
回复评论