EDIT: And As I Search on StackOverflow now I found This Question is Duplicate of : This and This
You need to use another function setTextSize(unit, size)
with unit SP
like this,
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f);
Please read more for TypedValue constants.
~ Answered on 2012-02-29 05:38:40