android / user-interface-samples

Multiple samples showing the best practices in the user interface on Android.
Apache License 2.0
4.33k stars 1.63k forks source link

Per-app language preferences not working properly in Compose Multiplatform below Android 12 #468

Open pankaj1920 opened 1 month ago

pankaj1920 commented 1 month ago

this is the actual function i created to change app language

actual fun changeAppLanguage(language: String) { AppCompatDelegate.setApplicationLocales( LocaleListCompat.forLanguageTags(language) ) }

For android 14 it is working fine in compose multiplatform if i change app language from inside app its working and if i close the app and reopen then also previous set language is coming.

But for android 12 and below it i click on language change btn then app language is not changing. i have to go some other screen and come back to reflect the language change. and if i close app and reopen then delfault language is setting previous selected language is not setting