This question has already been answered:

There is a text in the TextView , the text itself is registered in String .

Is it possible to somehow change the color of only parts of the text, and not all of it completely?

Reported as a duplicate by pavlofff , YuriySPb , Abyx , Merlin , Peter Olson January 13, 16 at 2:35 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Add programming language / platform tags. It is not clear what the textViev . - Pavel Parshin
  • textViev - text output window in android studio. text change tags do not work. - Oleg
  • Android Studio is just a tool for writing code and there is no “window” of text output in it. This is a “window” in Android (the OS on which the program written in Android Studio will run) - pavlofff
  • The same question 6 years ago in English-Saxon how can I use the textView? . Is on the first line of the issue of Google on the request android textview color part of text - Yuriy SPb
  • Please mark the answer as correct - Andrach

1 answer 1

 String s = "Hello Everyone"; SpannableString ss = new SpannableString(s); ss.setSpan(new ForegroundColorSpan(Color.RED), 0, 5, Spanned.SPAN_EXCLUSIVE_INCLUSIVE); // устанавливаем цвет слову Hello TextView tv= (TextView) findViewById(R.id.textview); tv.setText(ss); 

enter image description here

Source: http://java-help.ru/textview-multifont/