How to Set the Text in a TextView, in java

public final void setText (CharSequence text) was added in API level 1
Sets the string value of the TextView. TextView does not accept HTML-like formatting, which you can do with text strings in XML resource files. To style your strings, attach android.text.style.* objects to a SpannableString, or see the Available Resource Types documentation for an example of setting formatted text in the XML resource file.

1. Add a TextView in XML or Instantiate a TextView in Java named myTextView.

2. Declare a TextView named myTextView.

3. Add the below line to the onCreate method.

myTextView.setText("This is the text!");