i work with android 2.1 , and i want to get real path from Camera intent result. I read Get Path of image from ACTION_IMAGE_CAPTURE Intent but it is for android 2.2.
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CAMERA_RESULT) { Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); imv.setImageBitmap(thumbnail); Uri selectedImageUri = data.getData(); String path = getRealPathFromURI(selectedImageUri); } } private String getRealPathFromURI(Uri contentUri) { try { 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); } catch (Exception e) { return contentUri.getPath(); } }
selectedImageUriis NULL and let me know if this..