public final class LocaleUtil
extends java.lang.Object
Locale
.Modifier and Type | Method and Description |
---|---|
static java.util.Locale |
fromLanguageTag(java.lang.String tag)
Creates a Locale instance for a specific language tag.
|
static java.util.Locale |
getLocale(android.content.Context context)
Get the current user Locale.
|
static java.lang.String |
toLanguageTag(java.util.Locale locale)
Gets the language tag from a Locale.
|
public static java.util.Locale getLocale(android.content.Context context)
context
- The contextpublic static java.lang.String toLanguageTag(java.util.Locale locale)
locale
- The locale.public static java.util.Locale fromLanguageTag(java.lang.String tag) throws java.lang.IllegalArgumentException
tag
- The tag of the language.java.lang.IllegalArgumentException
- If the Tag is not a valid language tag.