I am working on android application in which i want to set my text size according to the screen. I am using the following method, but it is not re-sizing my text size according to the screen.
myRequestText.setTextSize(convertFromDp(21));//myRequestText is a textview
public float convertFromDp(int input) {
final float scale = getResources().getDisplayMetrics().density;
return ((input - 0.5f) / scale);
}