Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/app/LocaleManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/LocaleManager#inhmethods)

# LocaleManager

*** ** * ** ***

` public class LocaleManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.LocaleManager |

<br />

*** ** * ** ***

This class gives access to system locale services. These services allow applications to control granular locale settings (such as per-app locales) or override their list of supported locales while running.

Third party applications should treat this as a write-side surface, and continue reading locales via their in-process `https://developer.android.com/reference/android/os/LocaleList`s.

## Summary

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/os/LocaleList` | ` https://developer.android.com/reference/android/app/LocaleManager#getApplicationLocales()() ` Returns the UI locales for the calling app. |
| ` https://developer.android.com/reference/android/os/LocaleList` | ` https://developer.android.com/reference/android/app/LocaleManager#getApplicationLocales(java.lang.String)(https://developer.android.com/reference/java/lang/String appPackageName) ` Returns the current UI locales for a specified app (described by package name). |
| ` https://developer.android.com/reference/android/app/LocaleConfig` | ` https://developer.android.com/reference/android/app/LocaleManager#getOverrideLocaleConfig()() ` Returns the override LocaleConfig for the calling app. |
| ` https://developer.android.com/reference/android/os/LocaleList` | ` https://developer.android.com/reference/android/app/LocaleManager#getSystemLocales()() ` Returns the current system locales, ignoring app-specific overrides. |
| ` void` | ` https://developer.android.com/reference/android/app/LocaleManager#setApplicationLocales(android.os.LocaleList)(https://developer.android.com/reference/android/os/LocaleList locales) ` Sets the UI locales for the calling app. |
| ` void` | ` https://developer.android.com/reference/android/app/LocaleManager#setOverrideLocaleConfig(android.app.LocaleConfig)(https://developer.android.com/reference/android/app/LocaleConfig localeConfig) ` Sets the override LocaleConfig for the calling app. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### getApplicationLocales

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocaleList getApplicationLocales ()
```

Returns the UI locales for the calling app.

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/LocaleList` | This value cannot be `null`. <br /> |

### getApplicationLocales

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocaleList getApplicationLocales (String appPackageName)
```

Returns the current UI locales for a specified app (described by package name).

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

This API can be used by an app's installer (per `https://developer.android.com/reference/android/content/pm/InstallSourceInfo#getInstallingPackageName()`) to retrieve the app's locales.

This API can be used by the current input method to retrieve locales of another packages. All other cases require `android.Manifest.permission#READ_APP_SPECIFIC_LOCALES`. Apps should generally retrieve their own locales via their in-process LocaleLists, or by calling `https://developer.android.com/reference/android/app/LocaleManager#getApplicationLocales()`.

<br />

| Parameters ||
|---|---|
| `appPackageName` | `String`: the package name of the app for which to retrieve the locales. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/LocaleList` | This value cannot be `null`. <br /> |

### getOverrideLocaleConfig

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocaleConfig getOverrideLocaleConfig ()
```

Returns the override LocaleConfig for the calling app.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/LocaleConfig` | the override LocaleConfig, or `null` if the LocaleConfig isn't overridden. <br /> |

### getSystemLocales

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocaleList getSystemLocales ()
```

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`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.

**Note:** This API is not user-aware. It returns the system locales for the foreground user.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/LocaleList` | This value cannot be `null`. <br /> |

### setApplicationLocales

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setApplicationLocales (LocaleList locales)
```

Sets the UI locales for the calling app.

Pass a `https://developer.android.com/reference/android/os/LocaleList#getEmptyLocaleList()` to reset to the system locale.

**Note:** Changes to app locales will result in a configuration change (and potentially an Activity lifecycle event) being applied to the calling application. For more information, see the [section on handling configuration changes](https://developer.android.com/guide/topics/resources/runtime-changes). The set locales are persisted; they are backed up if the user has enabled Backup \& Restore.

**Note:** Users' locale preferences are passed to applications by creating a union of any app-specific locales and system locales, with the app-specific locales appearing first. Language resources are then chosen per usual (as described in the [section on locale resolution](https://developer.android.com/guide/topics/resources/multilingual-support)).

<br />

| Parameters ||
|---|---|
| `locales` | `LocaleList`: the desired locales for the calling app. This value cannot be `null`. <br /> |

### setOverrideLocaleConfig

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOverrideLocaleConfig (LocaleConfig localeConfig)
```

Sets the override LocaleConfig for the calling app.

**Note:** Only the app itself with the same user can override its own LocaleConfig.

**Note:** This function takes in a `https://developer.android.com/reference/android/app/LocaleConfig` which is intended to override the original config in the application's resources. This LocaleConfig will become the override config, and stored in a system file for future access.

**Note:** Using this function, applications can update their list of supported locales while running, without an update of the application's software. For more information, see the [section on dynamic updates for an app's localeConfig](https://developer.android.com/about/versions/14/features#app-languages).

Applications can remove the override LocaleConfig with a `null` object.

<br />

| Parameters ||
|---|---|
| `localeConfig` | `LocaleConfig`: the desired `https://developer.android.com/reference/android/app/LocaleConfig` for the calling app. This value may be `null`. <br /> |