开发者

Android: Camera orientation when started by Intent

开发者 https://www.devze.com 2023-02-07 19:53 出处:网络
I\'m starting Camera application to take a开发者_JAVA百科 picture via Intent: startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), 0);

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">
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号