0
我使用此代碼提取照片(ID,日期),但我不知道如何訪問照片(位圖),以便我可以顯示它!從圖庫中提取照片android
//提取照片的信息
public ArrayList<Image> checkGallerieFiles(){
String[] projection = new String[]{
MediaStore.Images.Media._ID,
MediaStore.Images.Media.DATE_TAKEN,
MediaStore.Images.Media.DATA
};
Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
ContentResolver cr = getActivity().getContentResolver();
Cursor cur = cr.query(uri, projection, "",null, "");
if (cur.moveToFirst()) {
while (cur.moveToNext())
{
Image newImage = new Image();
newImage.setImageName(cur.getString(cur.getColumnIndex(MediaStore.Images.Media._ID)));
newImage.setImageDate(cur.getString(cur.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN)));
myImageList.add(newImage);
}
}
return (myImageList);
}
getbitmap那正是我期待的! thkx – Marya
永遠歡迎@Marya你從哪裏來的俄羅斯? –
不,我是意大利人 – Marya