简体   繁体   中英

Android app terminates when screen orientation is changed

Please have a look at my .manifest ,although i have put

android:screenOrientation="sensor"

the moment i change my screen orientation the app will terminate (no crashing hence no log). I have read and added the below syntax

android:configChanges="orientation|screenSize|keyboardHidden"/>

but still no change.

have a look at my .manifest and suggest me how to resolve the issue (currently i have removed the android:configchanges part.)

      package="com.mystictreegames.pagecurl"
      android:versionName="1.1" android:versionCode="2">
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"/>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity
             android:label="@string/app_name"
             android:excludeFromRecents="true" 
             android:screenOrientation="sensor" 
             android:name="AndroidPageCurlActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity 
            android:screenOrientation="sensor" 
            android:label="@string/standalone_example" 
            android:name="StandaloneExample"></activity>

    </application>
</manifest>

尝试这个,

android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM