I am creating a textview and adding to the layout dynamically. I am using textView.setTextSize(18) method to set the text size.I tested it on samsung tablet and found that the font size is too small for this screen then I changed the textsize to 25 but it is too big for an emulator(480*800). My problem is to set text size dynamically so that it fits for all the screens.
I am creating a textview and adding to the layout dynamically. I am using
Share
You should use the resource folders such as
And write the text size in ‘dimensions.xml’ file for each range.
And in the java code you can set the text size with
Sample dimensions.xml