Can one have different colored text sentences in the same list view item in Android?

For example, look at this sentence:

"I have to get on at A4 junction, And Getoff at B2 junction".

Here I want to change the color of

"get on at A4 junction"

to blue in and

"getOff at B2 junction"

and other words to white in the same listview item. Can anyone give me the solution for this problem?

Upvotes: 0

Views: 175

Answers (1)

Lazy Ninja
Lazy Ninja

Reputation: 22537

Use Html.fromHtml

textview.setText(Html.fromHtml("your html") );

Learn basic html for the colors.

Upvotes: 1

Related Questions