I’m designing an app and I was just wondering how to make a different layout when in landscape mode. I created a folder in the res called “layout-land” and created an xml file but it does not work when I run the emulator. I tried calling it “main” but it says that already exists, which it does but in the “layout” folder. If I call it something different do I need to change something in the manifest? Thanks for the help!
Share
Just to clarify, if you are in landscape or portrait Android looks for the layout file in either the
-landdirectory first, if it’s not found then it checks the defaultlayoutdirectory. Your files should be named as follows, and will be loaded by the system depending at runtime on the device’s current configuration:Check the documentation on providing resources for more information.