Alex Rivera | Logout

The xml is not switching when device orientation change

Asked 2010-12-28T07:57:34.887
22


I have made two folders, res/layout and res/layout-land

The output i got
If I start the application in portrait mode, it will always use the xml in layout folder if the application run in portrait mode. And will not use xml in layout-land if i change the device to landscape mode
If it start in landscape mode it only use the xml in layout-land
The xml is not switching when the orientation change

What i expect was
It should use the xml in layout folder while it is in portrait mode and use the xml in layout-land while in landscape mode

In the Manifest file i have added android:configChanges="orientation" for the activity and

<supports-screens 
        android:resizeable="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:anyDensity="true" />

Did i missed any thing here? What changes i need to do here?
Thank You

Edit
Report

1 Answer

2

Do not forget to turn on Settings -> Display -> Auto-rotate screen option.

answered 2013-07-21T19:46:29.673

Your Answer