Android activity restarted at orientation change even with configChanges set

后端 未结 2 1116
没有蜡笔的小新
没有蜡笔的小新 2021-01-21 16:25

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:



        
2条回答
  •  孤独总比滥情好
    2021-01-21 17:21

    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.

提交回复
热议问题