1.
Warning:
// To get local formatting use getDateInstance (), getDateTimeInstance (), or
// GetTimeInstance (), or use new SimpleDateFormat (String template, Locale
// Locale) with for example Locale. US for ASCII dates. @ SuppressLint ("SimpleDateFormat ")
String string = new SimpleDateFormat("EEEE yyyy-MM-dd",Locale.getDefault()).format(new Date());
Solution:
Add Locale. getDefault ()
For example, like:
SimpleDateFormat newSimpleDateFormat = new SimpleDateFormat ("MM, dd, yyyy HH mm", Locale. getDefault ());
2. Warning:
Implicitly using the default locale is a common source of bugs: Use toUpperCase (Locale) instead
String string = new SimpleDateFormat ("EEEE", Locale. getDefault (). format (new Date (). toUpperCase ();
Solution:
Because uppercase is generally used only in English-speaking countries, Locale is specified as Locale. US.
String string = new SimpleDateFormat ("EEEE", Locale. getDefault (). format (new Date (). toUpperCase (Locale. US );
(Sometimes the warning prompt is still in progress and must be cleaned)
To be continued ......