How to create different layout for different orientation in android?
-
30-06-2021 - |
Question
I would like to have different activity.xml files for different orientations.
I have created a another folder with name layout-land
. When I copy and paste the activity_main.xml file into it, then screen size is automatically getting oriented to landscape.
But after doing this, code assist is not working. Its showing the following error when I press ctrl+s
Content assist not available at the current location
what is the reason for this? Did I do anything wrong for creating different layouts for both orientation?
Solution
This sounds like an IDE-specific issue more than anything. The way you're doing it is correct. Assuming you a layout with the same name in as the other inside of layout-land, you should be good to go. Just give it a whirl.
OTHER TIPS
Sounds like an Eclipse error to me (Googling "Content assist not available at the current location gives me a lot of hits); try running your application on a device and it will most likely work. It doesn't sound like you've done anything wrong.