[英]Android app closes when the orientation is changed
我希望我的應用程序在縱向視圖中運行,所以我在android清單文件中進行了以下更改。
android:screenOrientation="portrait"
它停留在縱向視圖中一秒鍾然后它關閉..我原以為這是我必須做的唯一改變..但我也添加了這個但它不起作用
android:configChanges="orientation"
我錯過了什么嗎?
<activity android:name=".Menu" android:label="COMEDY TRIVIA"
android:screenOrientation="portrait" android:configChanges="orientation"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="nik.trivia.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
試試這個將android:configChanges
添加到activity tag
中的AndroidManifest
文件中
<activity android:name=".Fourth" android:label="Fourth" android:configChanges="orientation|keyboardHidden"></activity>
希望這對你有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.