2

Try to use ContextAmbient.current.resources.updateConfiguration but it doesn't reflect the changes. Also, tried the re-assign context using createConfigurationContext.

val context = ContextAmbient.current
val config = context.resources.configuration
val locale = Locale("en")
config.setLocale(locale)
context = context.createConfigurationContext(config)
musso
  • 501
  • 1
  • 4
  • 5
  • There's already a `ConfigurationAmbient` you can use it directly – MR3YY Nov 13 '20 at 12:30
  • Thanks @MR3YY, Can you explain it further? i m using `ConfigurationAmbient.current.setLocale(Locale.English)` with `context.recreate()` or `context.createConfigurationContext(config)`, but no luck – musso Nov 14 '20 at 05:35
  • Did you solve it? If yes, any explanation how you did it – user565 Nov 09 '21 at 08:39
  • Did you solve it? – Tanjim ahmed Dec 28 '21 at 21:13
  • Does this answer your question? [How to trigger recomposition after updateConfiguration?](https://stackoverflow.com/questions/70991087/how-to-trigger-recomposition-after-updateconfiguration) – Phil Dukhov Feb 05 '22 at 09:29

0 Answers0