in my android application i have a string that contains a specific word so i want to display whole string in text view and the specific word should be highlighted.Hope following image will give you an idea.
I have used following code to do this but its not working.
CODE:
con is my string and groupNameContent is the text field.
con.replaceAll(arrGroupelements[groupPosition][5],"<font color='#CA278C'>"+arrGroupelements[groupPosition][5]+"</font>.");
groupNameContent.setText(Html.fromHtml(con));
for each word, you can use:
If I can understand you have the list of words and you want to find this words in text and highlight them so in this answer you have three input parameter:
yourTextview to show the result text