This is due to some confusing parts of the TextView API. setTextSize expects a SP (scaled pixels) value, while getTextSize returns the text size in pixels.
You want to set the size to 20 pixles, because Paint uses pixels for its text size, so you need to call setTextSize(int unit, float size).
Your method call should look something like this: setTextSize(TypedValue.COMPLEX_UNIT_PX, 20)
I've linked the method definition so you can check it out for yourself and see exactly what's going on.
Edit: The question you asked me in the comments section has already been answered on StackOverflow. Check it out.