I have an Activity that fires a camera intent like this (nothing special):
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
File photo = new File(Environment.getExternalStorageDirectory(), filename);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
Uri imageUri = Uri.fromFile(photo);
startActivityForResult(intent, CAMERA_REQUEST);
Than I get the result in onActivityResult()and set the bitmap to ImageView. Again, nothing special.
The problem is that the Camera app is always in the landscape. Therefore, if the user holds the device in horizontal orientation, when they click "OK" to send it back to my activity, and my activity was previously in the portrait, then it resets my activity, because it needs to rebuild it. If you tilt the device to portrait orientation before you press OK in the camera, this will not work. How do I get around this?
source
share