I have to put in the same textView a string with substrings of different sizes and colors. How can I do?

I have to put in the same textView a string with substrings of different sizes and colors. How can I do?

You need to create a String with HTML tags and set this String to TextView as Html.fromHtml like below:
((TextView) findViewById(R.id.txt)).setText(
Html.fromHtml("<Font color=\'" + "#457548"
+ "'\" >" + "your text"
+ "</Font>"), TextView.BufferType.SPANNABLE)
More information go to: how-display-html-android
You could attach html notation to the text, or put a textview for each different size and color in a linearlayout, why does it have to be strictly in one textview?
If you don't want to use HTML, you can use spannables in a custom view.
Have a look at some old questions those can give you some hints:
Android has SpannableString that can be set in a textView. Each SpannableString can have a different color, font , onCLick() and so on. Multiple SpanableStrings can be set to a single texview.