Hello,
Welcome to our Microsoft Q&A platform!
You could add the text content to strings.xml and set the textColor for the different text separately.
Here is the sample code, you could refer to it.
<TextView
android:id="@+id/textView1"
android:text="@string/test_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
Resource\values\strings.xml
<resources>
<string name="test_content">
normal text content
<font fgcolor="#ffff0000">Hello world!</font>
</string>
</resources>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.