You don't have to set the text first. There is nothing stopping you from creating a Spannable string and feeding that to setText(). I do the same thing using SpannableStringBuilder.
On Oct 22, 10:27 am, Jiri <jiriheitla...@googlemail.com> wrote: > Thank you, > > so I would first have to set the string to the field and then retrieve > it again using getText and then style it. That seems a bit of a way around. > > Well if thats how they made it, then thats how I will use it :) Or do I > misunderstand it? > > Jiri > > skink wrote: > > > On Oct 22, 4:57 pm, Jiri <jiriheitla...@googlemail.com> wrote: > >> Hello list, > > >> If I have a string resource, for instance: > > >> Hello world > > >> and I want to have "world" be colored differently when i put it to a > >> TextView. How do I do this? > > >> Jiri > > > Jiri, > > > use setSpan method > > > pskink > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---