Recently, the company code quality inspection has revealed the use of many outdated methods. Record:
1.fromHtml
replace:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
content.setText(Html.fromHtml(html.replaceAll("span style", "font color").replaceAll("span", "font").replaceAll("color:", ""),Html.FROM_HTML_MODE_LEGACY));
} else {
content.setText(Html.fromHtml(html.replaceAll("span style", "font color").replaceAll("span", "font").replaceAll("color:", "")));
}
2.new Date(.toLocaleString())
replace:
SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateTimeInstance();
sdf.format(new Date()