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 <ul> <li>T ype 1 </li> <li> Type 2 </li> </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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With