Android Question Incorrect layout view when changing screen orientation

Discussion in 'Android Questions' started by paulsvs, Jan 19, 2019.

  1. paulsvs

    paulsvs New Member

    Hello experts!
    I use this string android:configChanges="orientation|screenSize" in the manifest to save data when I change the orientation of the screen. OK, the information is saved, but the layout view does not adapt to the new orientation, i.e. for example, the portrait view doesn't change to landscape, yes it's rotated, and half cut from the bottom. The landscape view doesn't change to portrait, it's rotated and half cut to the right. How to fix it?

    When I don't use this string android:configChanges="orientation|screenSize", the screen orientation changes normally and all elements are placed correctly according to each orientation.

    Thanks in advance!
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is a mistake. You should use StateManager to keep the UI state. The data state shouldn't be affected by the activity life cycle at all.

    Relevant video tutorial:
  3. paulsvs

    paulsvs New Member

    Thank you, Erel. I'll learn it.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice