Jon
Jon

Reputation: 8021

Android: if I create xmls within the folders layout-sw.. is it worthwhile to maintain the same xmls in the default layout folder?

If I create xmls for several screen widths and utilize the folder structure layout-sw[some dp], is it necessary to maintain copies for these files in the default layout folder? Is there any situation where an xml filename would exist in an sw folder, but the xml with the same filename in the regular layout folder would be read instead when the activity was launched by the user?

Upvotes: 1

Views: 39

Answers (1)

Nanoc
Nanoc

Reputation: 2381

Its the recommended way of doing it.

Android will look from the more restrictive folder to the least (default folder).

So it will take the first it founds, the more restrictive.

That way you have the same xml filename on various folders and Android will choose the best for the current device.

Hope this helps.

Upvotes: 1

Related Questions