updateConfigurationIfSupported

fun updateConfigurationIfSupported(context: Context, config: Configuration, defaultLanguage: String): Configuration?

override fun attachBaseContext(newBase: Context?) { super.attachBaseContext(newBase) val config = Configuration() applyOverrideConfiguration(config) }

override fun applyOverrideConfiguration(overrideConfiguration: Configuration?) { overrideConfiguration?.apply { val oldUIMode = uiMode setTo(baseContext.resources.configuration) uiMode = oldUIMode } super.applyOverrideConfiguration(overrideConfiguration?.let { updateConfigurationIfSupported(it) }) }

Return

Configuration?

Parameters

context

Context

config

Configuration

defaultLanguage

String