Find the ViewGroup you want to add the TextView to, create the TextView, and add it to the ViewGroup, and if the ViewGroup is already visible you will need to re-validate it to force it to show the new data.
You should already know how to get the ViewGroup you want, and you can read the API on how to create a TextView and add it to the ViewGroup. Note, you mat also need to force the layout to happen again if there is not enough room for the new TextView and the ViewGroup was already visible.
A question you should ask yourself, though: Are you sure you want to build the layout in code? Or do you think you could make different layouts in XML and choose which one is appropriate to display depending on the data?