我通过以下方式启动相机:
Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camera, PICTURE_RESULT);
它可以正常工作,没有任何错误。唯一的问题是当我返回时,布局处于横向模式,即使我保持纵向。我可以在这里获取图像数据。
片刻后屏幕自动返回纵向模式,但随后数据丢失。
在清单中设置方向不起作用。
显现:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.camera"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.camera.MainActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
您对如何从相机返回到纵向的主要活动有任何提示吗?