Our app forces portrait or landscape mode based on screen size. Our layouts in the layout directory are for a default orientation of landscape. We have alternates as appropriate in layout-port. At start up, the app looks at the screen size and then sets the appropriate orientation. For example, to force portrait mode, we call:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
For one fragment, we have a special layout for portrait mode that lives in layout-port.
If the device, a tablet, is currently resting in a landscape position, the default layout in the layout directory is chosen. This seems contrary to what should happen.
Is there a way when we are forcing portrait mode that we can ensure the xml file in the layout-port directory is used?