Codigami / CFAlertDialog

MIT License
224 stars 47 forks source link

how use in setMessage html text? #19

Closed mngzir closed 5 years ago

mngzir commented 5 years ago

hi how use html text in setMessage? tnx

rahul-s commented 5 years ago

I know this is too late...but this should work. Haven't tried personally yet.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    dialog.setMessage(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>", Html.FROM_HTML_MODE_COMPACT));
} else { 
   dialog.setMessage(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));
}