setSystemLocale

abstract suspend fun setSystemLocale(locale: Locale)

Sets locale as the Android System Locale. This can be used to switch language on the Android system level. This API requires the Manifest.permission.CHANGE_CONFIGURATION permission.

When the system Locale is changed, Android system will apply a configuration change. Typically, this results in the Android Activity to be restarted.

Note:: If the locale is not supported by the Android system, because of an invalid language or region code, the typical behavior of the Android system is to fallback to US English. If locale is the same as the current system Locale, no change will take effect.

Parameters

locale

A Locale initialised with the desired language and region.