I am fetching my songs from the SD card and putting him to the list view.
I am using this method. but its taking some time and if path is different I didn\'t get tha
//try this its working code
public ArrayList> getAudioList() {
ArrayList> mSongsList = new ArrayList>();
Cursor mCursor = getContentResolver().query(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
new String[] { MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Media.DATA }, null, null, null);
int count = mCursor.getCount();
System.out.println("total no of songs are=" + count);
HashMap songMap;
while (mCursor.moveToNext()) {
songMap = new HashMap();
songMap.put(
"songTitle",
mCursor.getString(mCursor
.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME)));
songMap.put("songPath", mCursor.getString(mCursor
.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA)));
mSongsList.add(songMap);
}
mCursor.close();
return mSongsList;
}