I got mine working by converting the Uri to Bitmap
bitmap = MediaStore.Images.Media.getBitmap(
this.getContentResolver(), imageUri);
then I save it using
MediaStore.Images.Media.insertImage(
getContentResolver(), bitmap, "Title",
"Desc");
so this is my code for onActivityResult on Main.class
case 2:
if (resultCode == RESULT_OK) {
Bitmap bitmap = null;
Uri imageUri = camera.getImageUri();
try {
bitmap = MediaStore.Images.Media.getBitmap(
this.getContentResolver(), imageUri);
bitmap = camera.setImage(bitmap);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (currentView == 0) {
frontView.setImageBitmap(bitmap);
isFrontActive = true;
MediaStore.Images.Media.insertImage(
getContentResolver(), bitmap, "Title",
"Desc");
} else if (currentView == 1) {
rearView.setImageBitmap(bitmap);
isRearActive = true;
}
}
}
break;
and this is my Photo.class
private Uri imageUri; // Global
public void openCamera() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory(),
"Cloudstaff_Ron.jpg");
Uri imgUri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
this.imageUri = imgUri;
mActivity.startActivityForResult(intent, 2);
}