-1

I am beginner in Android application development, so please don't make it as a duplicate question.

My question is that how to change text color and font using spanablestring class.

for example: I am (beginner) in (Android) application (development).

1) how to change above three words font and color.

2) And how to change all words those are between rounded braces if I have many words.

Lukas
  • 812
  • 1
  • 14
  • 43
Naeem
  • 494
  • 1
  • 7
  • 25
  • Does this answer your question? [How can I change the color of a part of a TextView?](https://stackoverflow.com/questions/4032676/how-can-i-change-the-color-of-a-part-of-a-textview) – Abhinav Suman Dec 21 '19 at 11:25

1 Answers1

0

You can change the color like shown below:

Spannable wordtoSpan = new SpannableString("I am (beginner) in (Android) application (development).");        

wordtoSpan.setSpan(new ForegroundColorSpan(Color.BLUE), 15, 30, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

For more information on how to change the color look at this post.

To change the words in the brackets look at this.

Lukas
  • 812
  • 1
  • 14
  • 43
  • Example :("I am (beginner) in (Android) application {development}") i want change color of "development" what i do? mean above case was only about single brace but now two brace. please help me sir. – Naeem Dec 23 '19 at 15:09
  • @Naeem ask a new question explaining your problem with more details please. – Lukas Dec 23 '19 at 15:15
  • 1
    I just posted. please check. – Naeem Dec 23 '19 at 15:27