0
URI에 대한 이미지 비트 맵을 가져 오려고했지만 다음 오류가 발생합니다.URI에서 비트 맵을 가져 오는 중에 파일을 찾을 수 없습니다.
를 System.err (3102) : java.io.FileNotFoundException : 없음 콘텐츠 제공 : /storage/emulated/0/1.jpg
나는이 시도 코드,
Cursor mCursor;
mCursor=activity.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,mProjection,null, null, MediaStore.Images.Media.DEFAULT_SORT_ORDER);
if (mCursor != null) {
mCursor.moveToFirst();
do {
String strPath = mCursor.getString(mCursor
.getColumnIndex(MediaStore.Images.Media.DATA));
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(
activity.getContentResolver(), Uri.parse(strPath));
//Here i'm using bitmap
} catch (FileNotFoundException e) {
Log.i("Exception",
"Image file not found: " + e.getMessage());
e.printStackTrace();
} catch (IOException e) {
Log.i("Exception",
"Input Output Failure: " + e.getMessage());
e.printStackTrace();
}
} while (mCursor.moveToNext());
이 질문에서보세요 >>> http://stackoverflow.com/questions/20067508/get-real-path-from-uri-android -킷 캣 -new-storage-access-framework – 2Dee