Search code examples
androidcolorssettext

Android change every string color


I'd like to change the color of every word in the changing text. How can I do this?

selected.setText( "ID".Color.RED + "data".Color.BLUE);

Solution

  • More simple way:

    TextView.setText(Html.fromHtml("<some html color tag/>"));