This works great but I'm not sure how to adapt it to use if with multiple strings.
Off the cuff...
Step #1: Change changeTextinView()
to take a SpannableString
as the first parameter, instead of a TextView
.
Step #2: Modify onCreate()
to create a SpannableString
from dispStr
and pass that to changeTextinView()
, then take the SpannableString
and pass it to setText()
on the TextView
.
At this point, it should work as it did before, except that you will be in position to do:
Step #3: Call changeTextinView()
several times in succession, once per string.
Things will get somewhat messy if there is overlap (e.g., you want to format ABCDEF
one way and CDE
another way), but I am hoping that is not the case for you.