I am opening camera using following code
Intent captureImageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cordova.setActivityResultCallback(this); cordova.getActivity().startActivityForResult(captureImageIntent,RESULT_CAPTURE_IMAGE); and inside onActivityResult i am trying to get the path of the image that is stored in gallery , so that i can return it back to the web page.
here what i have tried so far
Uri uri = intent.getData(); // doesnt work i tried to use MediaStore.EXTRA_OUTPUT but in that case i am getting null intent.
captureImageIntent.putExtra(MediaStore.EXTRA_OUTPUT, mPhotoUri); so can anyone tell me how can i fetch the path ?
EDIT
String fileName = "temp.jpg"; contentValues values = new ContentValues(); values.put(MediaStore.Images.Media.TITLE, fileName); Uri mPhotoUri = cordova.getActivity().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);