title: Different sizes on 2 devices, even if I use "dp"
body: <p>I've 2 tablets:</p>
  
  <p>1 Samsung Android 3.0</p>
  
  <pre><code>    DisplayMetrics {density=1.0, width=600, height=976, 
  scaledDensity=1.0, xdpi=161.55031, ydpi=155.51021}
  </code></pre>
  
  <p>1 Low cost device, Android 2.3.3</p>
  
  <pre><code>    DisplayMetrics {density=1.0, width=480, height=800, 
  scaledDensity=1.0, xdpi=160, ydpi=160.42105}
  </code></pre>
  
  <p>If I use different layout for each screen size, both devices says they are large-long and mdpi, so I can't distinguish them by using layout folder names... The problem is:</p>
  
  <p>I use a TextView with textSize="20dp"</p>
  
  <p>In the firse device, text width is half of the screen, in the second device is bigger (80% of the screen width). Why? I expect that both devices display text in the same way if I use dp (and not px). I tried also with sp but nothing changes...</p>
  
  <p>(I used TextView as example, I've the same problem with all elements in the layout: button sizes, ...)</p>
  
  <p>I would try to use layout folder names like "layout-w600dp" or something else introduced in Android 3.2 but this is not the case.</p>
  
  <p>I know I can change element dimensions by code in onLayout() but I don't want to do that...</p>
  
  <p>Any suggestion?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I solved my problems with layouts using themes: <a href="https://stackoverflow.com/questions/11312398/android-activate-a-specific-dimens-xml-at-runtime/11342177#11342177">Activate a specific dimens.xml at runtime</a></p>