Android: Camera orientation when started by Intent
I'm starting Camera application to take a开发者_JAVA百科 picture via Intent:
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), 0);
But camera is always in landscape mode, even when you rotate your handset to portrait mode. Is there any way to make camera detect current orientation?
Thanks
The source for the camera app answers this question. See below an excerpt from the camera app manifest file. The screenOrientation tag is set to landscape. This app will not display in portrait. If you need portrait mode from a camera app then you may have to build your own.
<activity android:name="com.android.camera.Camera"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
**android:screenOrientation="landscape"**
android:clearTaskOnLaunch="true"
android:taskAffinity="android.task.camera">
精彩评论