Search code examples
androidxmlscreen-orientationdevice-orientation

Android any orientation XML layout


Hello I am trying to make my layout compatible with all orientation screen types (landscape/portrait). For that I am using layout-land and layout-port.

This works for devices that have only 2 orientation positions (landscape and portrait) but is not working if I rotate a device that supports 4 orientation positions (land left/right, port upside down/upside). Is working only on default land position but if I rotate the device on the other landscape position, android choose the layout-port layouts instead of layout-land.

How can I solve this problem in XML? Or the only solution is to manage myself the orientation changes?


Solution

  • It seems that the layout-land works.. the problem was that I managed the orientation change by myself and took only 2 types of orientation..

    (I manage the orientation just to get down the app title and make it full screen in landscape..)

    Thank you for your answers though