开发者

Android app closes when the orientation is changed

I want my app to run in the portrait view so I made the following changes in the android manifest file.

android:screenOrientation="portrait"

It stays in the portrait view for a second and then it closes.. I had assumed this is the only change i had to make..but i also added this but it isnt working

 android:configChanges="orientation"

Am i missing something?

     <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>


Try this adding android:configChanges to your AndroidManifest file in the activity tag

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

Hope this works for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜