Uri path is null? How do I get the image URI path? My code is:
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.TITLE, "Image File name");
mCapturedImageURI = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Intent intentPicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intentPicture.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedImageURI);
startActivityForResult(intentPicture,CAMERA_PIC_REQUEST);
OnActivityResult method
if (requestCode == CAMERA_PIC_REQUEST && resultCode == RESULT_OK) {
String videoPath = getRealPathFromURI(mCapturedImageURI);
}
But still image path is null (null pointer exception)
You need to initialise mCapturedImageURI before you can use it. Check the intent that is returned to onActivityResult: