Setting textSize programmatically

You have to change it to TypedValue.COMPLEX_UNIT_PX because getDimension(id) returns a dimen value from resources and implicitly converted to px.

Java:

textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, 
                     getResources().getDimension(R.dimen.result_font));

Kotlin:

textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, 
                     resources.getDimension(R.dimen.result_font))

Leave a Comment

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