I want to create textview programmatically and display horizontally if it fits on device screen else display in next row.
I have the screen's available width and some text. Based on that text I want to create textview and display it. I also have additional text which i want to display in first row if it fits there. Otherwise, it should go on the next row. The only problem is that I am not able to get the width of textview based on its text. I can't use wrap_content as it will not give me its width value.