Get dimension from xml and set text size (runtime)
<p>I have in dimens.xml:</p>

<pre><code>&lt;dimen name="text_medium"&gt;18sp&lt;/dimen&gt;
</code></pre>

<p>I get in runtime this value and set textView size: </p>

<pre><code>int size = context.getResources().getDimensionPixelSize(R.dimen.text_medium);
textView.setTextSize(size).
</code></pre>

<p>On tablet 10'' (1280x800) all ok. But on phone (800x480) I see textview with very large font. At tablet size equals 18, at phone 27.</p>

<p>If I set size manual by:</p>

<pre><code>textView.setTextSize(size)
</code></pre>

<p>normal size on both devices.</p>
