in my android app, I have a line containing a specific word, so I want to display the whole line in a text view, and a specific word should be highlighted. We hope that the following image will give you an idea.

I used the following code for this, but did not work.
CODE:
con is my string, and groupNameContent is a text field.
con.replaceAll(arrGroupelements[groupPosition][5],"<font color='#CA278C'>"+arrGroupelements[groupPosition][5]+"</font>."); groupNameContent.setText(Html.fromHtml(con));
Dinesh anuruddha
source share