Skip to content

Instantly share code, notes, and snippets.

@Oleur
Last active December 11, 2020 17:07
Show Gist options
  • Select an option

  • Save Oleur/fcbdf348926c30cbd00b10a8fa8dd78d to your computer and use it in GitHub Desktop.

Select an option

Save Oleur/fcbdf348926c30cbd00b10a8fa8dd78d to your computer and use it in GitHub Desktop.
override fun attachBaseContext(newBase: Context) {
var base: Context = newBase
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val config = resources.configuration
val locales = languageGateWay.getSupportedLocales()
config.setLocales(locales)
base = createConfigurationContext(config)
}
super.attachBaseContext(base)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment