Skip to content Skip to sidebar Skip to footer

Android Activity Restarted At Orientation Change Even With Configchanges Set

I have an Android library project and the main application that uses this library project. The manifest file of the main application looks as follows:

Solution 1:

You need to add keyboard|keyboardHidden to the android:configChanges attribute. Certainly on the emulator (and on certain devices, I think), when you change orientations the keyboard state also changes. This is also needed to prevent double-restarts of your activity when you don't have it handling orientation changes.

Solution 2:

If you use abs, it is a limitation, and you can't solve it. But you don't use that library, so give this in the activity tag in manifest file

 android:configChanges="keyboard|keyboardHidden|orientation"

remove that

 android:screenOrientation="sensor"

Post a Comment for "Android Activity Restarted At Orientation Change Even With Configchanges Set"