I want to take pictures in 2 mode landscape and portrait, but I don't want to create 2 layouts in landscape and portrait mode. I want to keep the screen in portrait mode and only rotate camera preview to take pictures. How can I rotate the camera preview (or detect screen orientation changed) when I set activity's screenOrientation="portrait" in manifest?
...
<activity
android:name=".ui.activity.CameraActivity"
android:screenOrientation="portrait">
...
So please give me some advice.