I would like to remove the deprecation warning for Html.fromHtml(string)
.
I tried to do like this:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
htmlSpanned = Html.fromHtml(string,Html.FROM_HTML_MODE_LEGACY);
} else {
//noinspection deprecation
htmlSpanned = Html.fromHtml(string);
}
but it still gives me a warning during compilation:
Warning:(18, 31) [deprecation] fromHtml(String) in Html has been deprecated