private Cursor getCursor(String filePath) {
String path = null;
Cursor c = getContentResolver().query(
.EXTERNAL_CONTENT_URI, null, null, null,
.DEFAULT_SORT_ORDER);
// ((("_data")));
if (()) {
do {
// Get the path through Cursor, if the path is the same, break;
("////////"+filePath);
path = (c
.getColumnIndexOrThrow());
("?????????"+path);
// Find the same path and return it. At this time, cursorPosition points to the Cursor pointing to the path and can return it
if ((filePath)) {
// ("audioPath = " + path);
// ("filePath = " + filePath);
// cursorPosition = ();
break;
}
} while (());
}
// These two have no effect, use it when debugging
// String audioPath = (c
// .getColumnIndexOrThrow());
//
// ("audioPath = " + audioPath);
return c;
}
private String getAlbumArt(int album_id) {
String mUriAlbums = "content://media/external/audio/albums";
String[] projection = new String[] { "album_art" };
Cursor cur = ().query(
(mUriAlbums + "/" + (album_id)),
projection, null, null, null);
String album_art = null;
if (() > 0 && () > 0) {
();
album_art = (0);
}
();
cur = null;
return album_art;
}
private void getImage(){
Cursor currentCursor = getCursor("/mnt/sdcard/"+mp3Info);
int album_id = (currentCursor
.getColumnIndexOrThrow(.ALBUM_ID));
String albumArt = getAlbumArt(album_id);
Bitmap bm = null;
if (albumArt == null) {
();
} else {
bm = (albumArt);
BitmapDrawable bmpDraw = new BitmapDrawable(bm);
(bmpDraw);
}
}