You are right it doesn't seem to work. Context.getString() strips out
the format tags.  The documentation implies it should work but the
mechanism is not explained or it is a bug.

It does work with the XML directly like -

<string name="foobar"><b>my <u>name</u> is <strike>sue</strike></b></
string>

android:text="@string/foobar"

On Feb 15, 5:59 am, Chrissshen <[email protected]> wrote:
> Hi,
>
> I have a string array and was trying to style certain parts of the
> text with tags like <b>, <i>, ... but it doesn't work.
> The array looks like this:
>
> <resources>
>         <array name="hour1">
>                 <item>blabla\n<b>blabla</b></item>
>         </array>
> </resources>
>
> The text is displayed in the textview like this:
> tTitel.setText(Html.fromHtml(Text[ii]));
>
> I tried it without Html.fromHtml too but this had no effect. The
> styling tags do work if i use them directly in the code, like:
> tTitel.setText(Html.fromHtml("blabla<b>blabla</b>");
>
> Any ideas how to style the text in an array??
>
> Cheers,
> Chris

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to