# LocaleManagerCompat

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

*** ** * ** ***


```
public final class LocaleManagerCompat
```

<br />

*** ** * ** ***

Helper for accessing features in `https://developer.android.com/reference/android/app/LocaleManager.html` in a backwards 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/annotation/AnyThread https://developer.android.com/reference/androidx/core/app/LocaleManagerCompat#getApplicationLocales(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Returns application locales for the calling app as a `https://developer.android.com/reference/androidx/core/os/LocaleListCompat`. |
| `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/annotation/AnyThread https://developer.android.com/reference/androidx/core/app/LocaleManagerCompat#getSystemLocales(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Returns the current system locales, ignoring app-specific overrides. |

## Public methods

### getApplicationLocales

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

```
@AnyThread
public static @NonNull LocaleListCompat getApplicationLocales(@NonNull Context context)
```

Returns application locales for the calling app as a `https://developer.android.com/reference/androidx/core/os/LocaleListCompat`. This API for non-`https://developer.android.com/reference/androidx/appcompat/app/AppCompatDelegate` context to easily get the per-app locale on the prior API 33 devices.

Returns a `https://developer.android.com/reference/androidx/core/os/LocaleListCompat#getEmptyLocaleList()` if no app-specific locales are set.

### getSystemLocales

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

```
@AnyThread
public static @NonNull LocaleListCompat getSystemLocales(@NonNull Context context)
```

Returns the current system locales, ignoring app-specific overrides.

**Note:** Apps should generally access the user's locale preferences as indicated in their in-process `https://developer.android.com/reference/android/os/LocaleList.html`s. However, in case an app-specific locale is set, this method helps cater to rare use-cases which might require specifically knowing the system locale.