Search code examples
androidandroid-cameraandroid-orientation

Camera confirmation changes to portrait from landscape


I have an app that is using the standard MediaStore.ACTION_IMAGE_CAPTURE to request an image be captured. When the device is in landscape orientation, the preview is also in landscape, but when the image is captured there's an intermediate confirm/retake screen (built-in, it seems). This intermediate step shows the just-captured image in portrait rather than landscape, even though the data comes to me in landscape after confirming.

I've tested this with the built-in camera apps on 5.1 and 4.4.4 with equivalent results.

I had previously used a custom camera implementation to fix this, but I reverted back to this intent workflow to preserve much of the built-in behavior I didn't want to have to replicate.

Is there some intent flag or other setting I can use to signal that the orientation should somehow remain the same or do I have to use my own camera implementation to fix this?


Solution

  • I've tested this with the built-in camera apps on 5.1 and 4.4.4 with equivalent results.

    There are thousands of Android device models. They ship with hundreds of different "built-in camera apps". Each of these apps can handle ACTION_IMAGE_CAPTURE how it wants to, and some of those apps have bugs or undesired behavior.

    I reverted back to this intent workflow to preserve much of the built-in behavior I didn't want to have to replicate.

    There is no "built-in behavior" that is guaranteed across all of the different possible camera apps.

    Is there some intent flag or other setting I can use to signal that the orientation should somehow remain the same

    No.