Skip to content

Instantly share code, notes, and snippets.

@giorgioprovenzale
Created March 20, 2018 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giorgioprovenzale/784d2c2faaa98f2bf8924e4514948954 to your computer and use it in GitHub Desktop.
Save giorgioprovenzale/784d2c2faaa98f2bf8924e4514948954 to your computer and use it in GitHub Desktop.
Android - Utils - Format text with HTML
@SuppressWarnings("deprecation")
public static Spanned fromHtml(String html){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment