ConfigurationCompat

Added in 1.1.0

public final class ConfigurationCompat


Helper class which allows access to properties of Configuration in a backward compatible fashion.

Summary

Public methods

static @NonNull LocaleListCompat

Get the LocaleListCompat from the Configuration.

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

Set the Locale into Configuration.

Public methods

getLocales

Added in 1.1.0
public static @NonNull LocaleListCompat getLocales(@NonNull Configuration configuration)

Get the LocaleListCompat from the Configuration.

Returns
@NonNull LocaleListCompat

The locale list.

setLocales

Added in 1.11.0
public static void setLocales(
    @NonNull Configuration configuration,
    @NonNull LocaleListCompat locales
)

Set the Locale into Configuration. This API is no-op on API 16 and earlier.

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jul 12, 2023

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jul 2, 2024

Follow best practices, eliminate boilerplate code, and reduce fragmentation

Updated Nov 6, 2024