Suppose I have a layout in the main, non-DPI specific layout resource folder, and that layout does an <include> of a sub layout that exists in both the hdpi/mdpi/ldpi folders. Can I expect the final inflated layout to aggregate either the h/m/l-dpi sub layout depending on the device DPI, just as for “full” layouts?
Thanks!
Whereas at the time of the post I did not have an opportunity to test out the proposition of the post, I have since had a chance to do so, and thus will answer my own question, since noone else has done so.
Yes, the following scenario works as expected (tested at API level 8):
layout/main.xml:
layout/included.xml:
layout-ldpi/included.xml:
Running the app on, say, a QVGA device renders a view in which the included part is from the LDPI directory as desired, whereas a non LDPI device grabs the default one from the layout directory.