# ConfigurationCompat

# ConfigurationCompat

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/os/ConfigurationCompat.java+class:androidx.core.os.ConfigurationCompat)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/os/ConfigurationCompat "View this page in Java")

<br />

```
class ConfigurationCompat
```

<br />

*** ** * ** ***

Helper class which allows access to properties of[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)in a backward compatible fashion.

## Summary

|                                                ### Public functions                                                |
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat) | [getLocales](https://developer.android.com/reference/kotlin/androidx/core/os/ConfigurationCompat#getLocales(android.content.res.Configuration))`(configuration: `[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)`)` Get the[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat)from the[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html).                                                                                                                   |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                        | [setLocales](https://developer.android.com/reference/kotlin/androidx/core/os/ConfigurationCompat#setLocales(android.content.res.Configuration,androidx.core.os.LocaleListCompat))`(configuration: `[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)`, locales: `[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat)`)` Set the[Locale](https://developer.android.com/reference/java/util/Locale.html)into[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html). |

## Public functions

### getLocales

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
java-static fun getLocales(configuration: Configuration): LocaleListCompat
```

Get the[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat)from the[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html).  

|                                               Returns                                                |
|------------------------------------------------------------------------------------------------------|------------------|
| [LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat) | The locale list. |

### setLocales

Added in[1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)  

```
java-static fun setLocales(configuration: Configuration, locales: LocaleListCompat): Unit
```

Set the[Locale](https://developer.android.com/reference/java/util/Locale.html)into[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html). This API is no-op on API 16 and earlier.