Hi Dan,
  Thanks a lot.
  I will try it.

On May 8, 3:11 am, "Dan U." <[EMAIL PROTECTED]> wrote:
> The first example I'm pretty sure doesn't work. I think it only
> supports bold, italic, and maybe underline tags. I haven't tried doing
> what you are, but I remember someone having the same kind of question.
> I think the advice was to look at SpannableString and
> SpannableStringBuilder
>
> On May 7, 9:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >   I am trying to edit a styled text.
> >   My goal is to display a string, for example "This is a color string"
> > and  the word "color" is in different color.
>
> >   My first solution is to create a string resource like this
> >   values.xml
> >     <string name="color_string">This is a <font color="#cc33ff">color</
> > font> string</<string>
> >   TextTest.java
> >     String text = getResources().getString(r.string.color_string);
> >     (TextView)myView.setText(text);
> >   Solution 1, failed.
>
> >   The second solution is to use android.text.Html package
> >     String htmlText = Html.fromHtml(text);
> >     (TextView)myView.setText(htmlText);
> >   This solution is also failed.
>
> >   Does anyone can help on this?
>
> >   Thanks a lot.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to