Monday, March 4, 2019

textview - How to add bulleted list to android application?



I have googled my question but there is not working answer provided. How do add a bulleted list to my textview.


Answer




Tough to do as ul/li/ol are not supported. Fortunately you can use this as syntactic sugar:



• foo
• bar
• baz


is the html entity for a list bullet
more choices are here http://www.elizabethcastro.com/html/extras/entities.html




more about which tags are supported provided by Mark Murphy (@CommonsWare)
http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html
Load that up with Html.fromHtml



((TextView)findViewById(R.id.my_text_view)).setText(Html.fromHtml(myHtmlString));

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...