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 android-beginners@googlegroups.com
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