0
votes

Just a quick question:
My application should work both for my device (Galaxy Ace - 320 x 480 - "Normal" screen size family) and for the Galaxy Nexus (720 x 1280 - "Normal" screen size family).
I wrote two layouts in two different folders: layout and layout-sw600dp.
Unfortunately the Galaxy Nexus keep to choose the xml definition in the "layout" folder instead of "layout-sw600dp" one.

How can I solve this?

Thank you in advance.

1
Without checking any details, are you sure you have to solve something? The normal etc terminology refers to dp, not px. So the behaviour might be correct. I'm just telling you this because you mix px and dp in your question, so you might already know this.class stacker
The question is: how can I make the Galaxy Nexus choose a different layout xml file (not the one in "layout" folder)?Michele
The answer is: By placing it into a resource folder in which it will look for it. density may be suitable if my guess is right. Here[(http://developer.android.com/guide/practices/screens_support.html) are the rules. And logging the [DisplayMetrics will help you to figure what the device will choose.class stacker
Perfect, copied. I was a little bit confused. So, the right answer is: place it in a folder called: "layout-xhdpi". Now it works, thank you very much!Michele

1 Answers

0
votes

(Thanks to @Class Stacker)

For everyone who has the same issue: put the layout xml file for the Galaxy Nexus in a folder called "layout-xhdpi".