Either:
-
Use
Html.fromHtml(String)on all API levels, or, -
Use
Html.fromHtml(String)on API Level 23 and older devices, andHtml.fromHtml(String, int)on API Level 24+ devices, usingBuild.VERSION.SDK_INTto find out the API level of the device that you are running on
In this case, “deprecated” is a hint to go look for the two-parameter method, but the one-parameter method still works and (in all likelihood) will do so for quite some time.