gpt4 book ai didi

android - 当方向改变android时 Activity 重新启动?

转载 作者:太空宇宙 更新时间:2023-11-03 11:43:54 25 4
gpt4 key购买 nike

<分区>

我有一个应用程序,我在其中使用横向和纵向模式。我在每次 Activity 中都使用了 android:configChanges="orientation|keyboardHidden"。因此,当我在设备 2.3 上运行它时,它完全可以正常工作并且 Activity 不会重新启动。但是,当我在 android 4.0 及更高版本中打开相同的应用程序时,只要更改方向, Activity 就会重新启动。 这是我的 xml 文件。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iconnect.collaborator"
android:versionCode="1"
android:versionName="1.0" >


<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true" />
<supports-screens android:smallScreens="true" />
<supports-screens android:normalScreens="true" />
<supports-screens android:largeScreens="true" />


<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


<application

android:icon="@drawable/cnlogomini"
android:label="CollaborateNow"
android:largeHeap="true"
android:allowBackup="true"
android:theme="@style/AppTheme" >
<activity android:name="jim.h.common.android.zxinglib.CaptureActivity"
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity android:name=".Register"
android:configChanges="orientation|keyboardHidden" ></activity>
<activity android:name=".ppllogincopy"

android:configChanges="orientation|keyboardHidden"></activity>

<activity android:name=".Password"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".Camerascan"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".TabGroup1Activity"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".newtab"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".SubmitData"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".peoplelist"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".GenerateQrcode"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".contact"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".peoplelistlogin"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".Startnew"
android:configChanges="orientation|keyboardHidden"

></activity>
<activity android:name=".projectdetails"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".Signup"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".RegisterScan"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".peoplelistscan"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".Profile"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".List"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".Logout"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".scanRegister"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".scanList"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name="scanCamera"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name="com.iconnect.collaborator.Camera"

android:configChanges="orientation|keyboardHidden"></activity>
<activity android:name=".collaborations"

android:configChanges="orientation|keyboardHidden"></activity>


<activity
android:name="com.iconnect.collaborator.MainActivity"


android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com