I accidentally discovered that if you have an activity that is configured for one orientation, but contains a separate layout file for a different orientation, when the action is first launched, it will be overestimated with a layout file that matches the physical orientation of the device and not a layout file that matches the orientation Activity Thus, if AndroidManifest.xml indicates
<activity android:name=".activities.LandscapeGardener" android:screenOrientation="sensorLandscape"> </activity>
and in the layout-port folder there is a layout for LandscapeGardener , if the activity is loaded into the portrait one, the portrait layout will be overestimated.
The reason why we have this situation, by the way, is that the Activity we are developing has some portrait-related errors, so we decided to suppress portrait mode for users while we fix them, but, of course, this problem makes suppression somewhat partial!
Please note that if the device is correctly oriented at startup, it will not change to the wrong layout.
source share