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.