LocaleManager.GetApplicationLocales(String) Method

Definition

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

[Android.Runtime.Register("getApplicationLocales", "(Ljava/lang/String;)Landroid/os/LocaleList;", "GetGetApplicationLocales_Ljava_lang_String_Handler", ApiSince=33)]
[Android.Runtime.RequiresPermission("android.permission.READ_APP_SPECIFIC_LOCALES")]
public virtual Android.OS.LocaleList GetApplicationLocales (string appPackageName);
[<Android.Runtime.Register("getApplicationLocales", "(Ljava/lang/String;)Landroid/os/LocaleList;", "GetGetApplicationLocales_Ljava_lang_String_Handler", ApiSince=33)>]
[<Android.Runtime.RequiresPermission("android.permission.READ_APP_SPECIFIC_LOCALES")>]
abstract member GetApplicationLocales : string -> Android.OS.LocaleList
override this.GetApplicationLocales : string -> Android.OS.LocaleList

Parameters

appPackageName
String

the package name of the app for which to retrieve the locales.

Returns

Attributes

Remarks

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

Returns a LocaleList#getEmptyLocaleList() if no app-specific locales are set.

This API can be used by an app's installer (per 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 #getApplicationLocales().

Java documentation for android.app.LocaleManager.getApplicationLocales(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to