I am sure this question has been asked a few times but I am not able to find the answer on stackoverflow.com
What I need is that there be 2 layout files activity_main_pot.xml activity_main_land.xml Based on the orientation
How to achieve this?
I am sure this question has been asked a few times but I am not able to find the answer on stackoverflow.com
What I need is that there be 2 layout files activity_main_pot.xml activity_main_land.xml Based on the orientation
How to achieve this?
Just name both layout files with the same name (like activity_main.xml) and just put the landscape one in your res/layout-land
folder (create the folder if it doesn't exist). The rest is done for you automatically by the framework.
My Dear Friend, it's a very simple. Android Use to render the whole screen on changing the layout. if the phone/device is in landscape then it first check the layout in folder "layout-land", if it is not then it draws from the layout folder and vice versa.
Solution: Just Create another folder "layout-land" and paste your landscape layout file in this folder. And same file name with portrait layout in "layout" folder. It will work :)