我有这段代码(在某个地方找到的):
public static List<MyImages> getImages(Activity context) {
List<MyImages> lst = new ArrayList<MyImages>();
Cursor cursor = getCameraThumbImages(context);
if (cursor != null) {
int columnIndex = cursor
.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);
int columnIndexPath = cursor
.getColumnIndexOrThrow(MediaStore.Images.Thumbnails.DATA);
int columnIndexImagePath = cursor
.getColumnIndexOrThrow(MediaStore.Images.Thumbnails.IMAGE_ID);
int count = cursor.getCount();
for (int i = 0; i < count; i++) {
cursor.moveToPosition(i);
int imageID = cursor.getInt(columnIndex);
String path = cursor.getString(columnIndexPath);
Uri imgThmbPath = Uri.withAppendedPath(
MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, ""
+ imageID);
String hope = cursor.getString(columnIndexImagePath);
MyImages p2p = new MyImages(path, "" + imageID);
lst.add(p2p);
}
}
return lst;
}
这段代码使我能够访问手机上的图像缩略图。问题是我不知道如何从中获取原始图像路径。
问题是:给定缩略图(或游标),我该如何获取原始图像路径?