I am creating an Android application and now I want to add layouts for different orientations. I created a folder with layouts and placed a different layout for my first launch activity "myStartActivity" (with the same name as before than for both orientations).
Depending on the orientation of the screen, before I started the application, the correct layout was selected: "myLayout.xml" from the "layout" folder when I start in portrait and "myLayout.xml" from "layout-land" when I start in the landscape.
The problem is that when I rotate the device, when I am already in Activity, after rotation I do not get a new layout. For example: turning from portrait to landscape, it still shows “myLayout.xml” from inside the “layout” folder, not the “layout-earth” folder, as it should be.
I did not overwrite any OnConfigurationChange methods or anything else. All I do in "myStartActivity" is to create some buttons and give them some listeners. I want to use a different layout in the landscape to reorder the buttons.
source share