Home > Software design >  Config.locale is deprecated
Config.locale is deprecated

Time:11-11

val locale = Locale(country)
Locale.setDefault(locale) 
val config: Configuration = baseContext.resources.configuration
config.locale = locale //deprecated

I'm using above code and config.locale is deprecated. How should I apply locale into config now?

CodePudding user response:

Use instead

config.setLocale(locale)
  • Related