How to avoid activity re-creation when being rotated, while also respecting orientation lock?

后端 未结 1 1518
傲寒
傲寒 2021-01-24 11:53

Background

Each time the device is being rotated, Android will destroy the current activity and re-create it with the new configuration.

An easy way to avoid a

1条回答
  •  心在旅途
    2021-01-24 12:17

    OK, never mind. I think I just missed the correct one:

    android:screenOrientation="user"

    Together with the other configChanges values, this works perfectly.

    0 讨论(0)
提交回复
热议问题