1

Want to block the allowed Locales available on our app. For instance I have this line of code:

sdf = new SimpleDateFormat(DateFormat.getBestDateTimePattern(Locale.getDefault(), "MMMM yyyy"));

If the user has French or Spanish set as one of their supported Locales on their phone, then I want this line of code to return in a Spanish or English format. If their only supported locale is Chinese, then I want it to revert to the default (English).

Instead of calling Locale.getDefault(), I could create another method that gets me this info, but hoping for a simpler/better solution than that.

DavidR
  • 6,622
  • 13
  • 56
  • 70
  • For anyone showing up here looking for an answer to this question. The way to really go about it is probably best answered here: https://stackoverflow.com/questions/31566270/force-locale-for-android-flavor-with-resconfig – DavidR Jun 18 '20 at 04:48

0 Answers0