Sadly, <li> is not supported in TextView. Only a few tags are actually supported by the widget so the options are pretty limited. You can either place your HTML code in a WebView or, if you really want to place it inside a TextView, you can use • instead.
There will be cases where we may want our text in strings.xml intact without adding HTML tags in order for hyperlinks to be shown as underlined and colored blue. Just like my experience.
I did not want the text in my strings.xml file for this certain variable to have HTML formatted tags within it.
Let us have an example:
<string name="test">This is a hyperlink, so <a href="http://www.google.com">click me</a>.</string>
To make the hyperlink in the TextView to be linkable, simply call this programmatically:
That is all. Do not add the attribute android:autoLink=”web” in your layout XML, or else it won’t work.
An Android Widget does not provide any way to get a reference to any control like a TextView. So what if you wanted a horizontal scrolling marquee TextView?
While doing it in an app is pretty easy since you can get hold of a TextView object and even doing it programmatically by giving focus to the TextView object, a widget is different. However, there is a way within the XML to make this happen.
See the XML example.
android:text="this is a horizontal scrolling text sample ..."
<requestFocus android:focusable="true" android:focusableInTouchMode="true"
This way, whenever your widget gets called, the TextView that will display the marquee text will have focus right away and will be able to show the horizontal animating effect that you so want.