Class LocaleCompat


  • public final class LocaleCompat
    extends java.lang.Object
    This class contains a simple implementation of Locale.forLanguageTag(String) for Android API levels below 21 (Lollipop). This is needed as core library desugaring does not backport that method as of this writing.
    Relevant issue: https://issuetracker.google.com/issues/171182330
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Optional<java.util.Locale> forLanguageTag​(java.lang.String str)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • forLanguageTag

        public static java.util.Optional<java.util.Locale> forLanguageTag​(java.lang.String str)