TextView – setting the text size programmatically doesn’t seem to work

the method TextView.setTextSize(int unit , float size); takes two parameters .

Try this :

text.setTextSize(TypedValue.COMPLEX_UNIT_SP,14);

refer this and this.

UPDATE:
Now the setTextSize(float size) will set the text size automatically in “scaled pixel” units. no need to mention the COMPLEX_UNIT_SP manually.
Refer to the documentation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)