I use this code to get a picture from camera and put it on imageview:
private void openCamera() { mMediaUri =getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
It can be done as simple as below . Put these 2 lines in onCreate of your activity.
StrictMode.VmPolicy.Builder newbuilder = new StrictMode.VmPolicy.Builder(); StrictMode.setVmPolicy(newbuilder.build());
URI exposure will be ignored by Vm I resolved my issue so.