I want to set custom font for a word which is appears any where in a string.
Ex : Hai @abc how are you ? , Hello my dear friend where you @abc
In the above examples, i have to apply custom font for "abc". I tried with Spannable class, but i am unable to get it.
final TextView txtComments = (TextView)view.findViewById(R.id.tv_comments);
SpannableStringBuilder SS = new SpannableStringBuilder(alcomments.get(i));
SS.setSpan (new CustomTypefaceSpan("", tf), 0, SS.length(),Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
txtComments.setText(SS);
But it is affecting the entire string. Please guide me how to achieve it.