Dimen value not working like expected
<p>I'm having trouble understanding the dimen resource attribute.</p>

<p>I have 3 value folders: value-normal, value-large and value-xlarge.</p>

<p>I have defined the titlesize as 20 for normal, 25 for large and 30 for xlarge, this is my normal value file:</p>

<pre><code>&lt;resources&gt;
    &lt;dimen name="titleSize"&gt;20sp&lt;/dimen&gt;
&lt;/resources&gt;
</code></pre>

<p>But when I try to get this value</p>

<pre><code>Resources r = getResources();
tvTitleSize = r.getDimension(R.dimen.titleSize);
</code></pre>

<p>tvTitleSize is equal to 40 which is offcourse to big. Why is the value the double of the original and how can I fix this? </p>

<p>Ps: my device is galaxy nexus.</p>
