Created
July 21, 2018 14:11
-
-
Save madhankumardroid/de86d74e7444ad2ee5ab590d8276cfc4 to your computer and use it in GitHub Desktop.
Get Language from Android Mobile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getLanguage() { | |
Locale locale = Locale.getDefault(); | |
String country = locale.getCountry(); | |
StringBuffer language = new StringBuffer(locale.getLanguage()); | |
language.append("-"); | |
language.append(country); | |
return language.toString().toLowerCase(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment