I want to get a Locale object from a line like "ru" or "en", etc. Can I somehow do this without if else ? For Android> = 16.

    1 answer 1

    According to the dock , the Locale class has a constructor with one single traceable string, which can be of the form ru , en etc. Those. just create a locale like this:

     Locale locale = new Locale("ru");