# 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)

*** ** * ** ***


```
public final class ConfigurationCompat
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/os/LocaleListCompat` | `https://developer.android.com/reference/androidx/core/os/ConfigurationCompat#getLocales(android.content.res.Configuration)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Configuration.html configuration)` Get the `https://developer.android.com/reference/androidx/core/os/LocaleListCompat` from the `https://developer.android.com/reference/android/content/res/Configuration.html`. |
| `static void` | `https://developer.android.com/reference/androidx/core/os/ConfigurationCompat#setLocales(android.content.res.Configuration,androidx.core.os.LocaleListCompat)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Configuration.html configuration, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/os/LocaleListCompat locales )` Set the `https://developer.android.com/reference/java/util/Locale.html` into `https://developer.android.com/reference/android/content/res/Configuration.html`. |

## Public methods

### getLocales

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

```
public static @NonNull LocaleListCompat getLocales(@NonNull Configuration configuration)
```

Get the `https://developer.android.com/reference/androidx/core/os/LocaleListCompat` from the `https://developer.android.com/reference/android/content/res/Configuration.html`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/os/LocaleListCompat` | The locale list. |

### setLocales

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

```
public static void setLocales(
    @NonNull Configuration configuration,
    @NonNull LocaleListCompat locales
)
```

Set the `https://developer.android.com/reference/java/util/Locale.html` into `https://developer.android.com/reference/android/content/res/Configuration.html`.