How do I fix orientation in lanscape and portrait?

view story

http://stackoverflow.com – I am using a layout under layout-xlarge and layout-xlarge-land. I have set the background color of layout under xlarge as red (portrait) and color of layout under landscape as green.Now when I enter my app and click on the fragment navigating to this layout in the portrait mode , it displays red as expected, now when i tilt the device to landscape , it remains red. Now when i navigate across the app and come back to this layout in the landscape mode it shows green as expected but when i tilt it remains green.How do i make it work such that the layout displays red ONLY for portrait and green la (HowTos)