Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unordered list styling with HTML markup

Tags:

android

In the link String Resource I came to know that Android supports only Bold, Italic and Underline styling with HTML markup, and I have seen some Application that displays Unordered list inside the AlertDialog, so tried to implement that in my application as

in my String.xml, I've given

<String name="unorderedlist">Different Types &lt;ul> &lt;li>T ype 1 &lt;/li> &lt;li> Type 2 &lt;/li> &lt;/ul> </String>

in my activity, I tried to display it inside my AlertDialog as follows

String formatedString=String.format(getResources().getString(R.string.unorderedlist), "");
myAlertDialogBuilder.setMessage(Html.fromHtml(formatedString));

Its not working, So is there any other way to do this, give me some guidance. Thanks in Advance.

like image 813
Vignesh Avatar asked Nov 14 '22 23:11

Vignesh


1 Answers

I saved the file that should be displayed as HTML page an HTML file inside the assets folder and designed a Custom Dialog box with a WebView and in the Java file I loaded the HTML file from the local resource and displayed it inside WebView.

like image 189
Vignesh Avatar answered Dec 29 '22 04:12

Vignesh