I have a small doubt and I would like if you could make. Currently, I have a String and I check if a word using ".contains("String");" as for example:
TextView tv = (TextView) dialog.findViewById(R.id.txtr);
for (int x = 1; x < 2; x++) {
tv.append("Text one\n");
tv.append("Text Two\n");
}
if(tv.getText().toString().contains("Text one")){
//Found
}else{
//Not found
}
My question is this. Can I do conditional and if you find the word I'm looking, apply a style?
if(tv.getText().toString().contains("Text one")){
tv.setTypeface(null, Typeface.BOLD); //I found text. Apply text bold
}else{
//Not found
}
Regards!