回报我通过启动相机:Startactivity的结果,在横向模式下
Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camera, PICTURE_RESULT);
它的工作没有任何错误。唯一的问题是,当我回来时,布局是在风景模式eventhough im肖像举行。我能够在这里获取图像数据。
屏幕短时间后自动返回肖像模式,但数据丢失。
在清单中设置方向不起作用。
清单:
<?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>
你有关于如何从相机在人像返回mainactivity任何提示?
您的活动试过吗? android:screenOrientation =“portrait” – R9J
是的,我有!仍然返回风景,并在旋转回肖像之后不久返回 – Sebastian