146k views
4 votes
Which of the following directories should you use to store a layout that's designed for landscape orientation?

a. src/layout
b. src/layout-land
c. res/layout
d. res/layout-land

User Nonamelive
by
7.5k points

1 Answer

2 votes

Final answer:

The correct directory to store a layout that's designed for landscape orientation is res/layout-land.

Step-by-step explanation:

The correct directory to store a layout that's designed for landscape orientation is res/layout-land.

In Android development, the res directory is used to store resources like layouts, images, and strings. Within the res directory, the layout-land folder is specifically meant for landscape orientation layouts. This allows the app to automatically select the appropriate layout based on the device's orientation.

For example, if you have two layouts, activity_main.xml in the res/layout directory for portrait orientation and activity_main.xml in the res/layout-land directory for landscape orientation, the system will automatically load the correct layout based on the device's orientation.

Therefore, the correct answar is d. res/layout-land

User Diego Martinoia
by
7.3k points