2

I have two devices: first is 320x480px 3.5" second is 540x960px 5.3"

I want the first one to display the shorter string so I add :

values-ldpi/strings.xml

values-normal-mdpi/strings.xml

But the second device is displaying modified string anyway, however it is clearly not normal size and a little closer to the hdpi range. Why is it happening?

Edit:

All the strings are located in values/strings.xml. For the "small"(first) device I need to override some strings to be a little shorter, but the second device should use default, so I put overridden strings into values-ldpi/strings.xml values-normal-mdpi/strings.xml but the second device picks up overriden strings. Why? here are devices parameters

first deviceenter image description here

satorikomeiji
  • 469
  • 6
  • 16

1 Answers1

1

instead of using DPIs to discriminate device screens, rather use small, normal, large, etc. So your res folders will include:

res/values/strings.xml
res/values-small/strings.xml
res/values-normal/strings.xml
res/values-large/strings.xml
res/values-xlarge/strings.xml

Give this a try and let us know if it helps.

ishmaelMakitla
  • 3,784
  • 3
  • 26
  • 32