content:// 관련된 값을 가져와서 이미지뷰에 뿌려주려고 하는데....잘안되네요 ㅠ
처음으로 이미지를 가져와서 -> 디비에 값을 저장하고 -> 저장한 값을 뿌려셔 -> 이미지뷰에 보이고 싶거든요 ㅠ
String으로 값을 가져와서 안되는것 같은데 ...
Uri 클래스에 Detail_img_value 객체를 만들어야 되는데.... 어렵네요 ㅠㅠ
방법줌 부탁 드립니다. 수고하세요 ~ ^^
String Detail_img_value = content://media/external/images/media/361
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inSampleSize = 4;
bitmap = BitmapFactory.decodeFile(getRealPathFromURI( Detail_img_value , opt);
imageview.setImageBitmap(bitmap); //이미지
}
}
public String getRealPathFromURI(Uri contentUri){
String []proj = {MediaStore.Images.Media.DATA};
Cursor cursor = managedQuery(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}