I am trying to get user language with country code, like en-US
, es-es
, but when i use Locale.getDefault().getCountry()
, it returns empty string. Although it gives me correct language on Locale.getDefault().getLanguage()
Asked
Active
Viewed 2,087 times
5

dev90
- 7,187
- 15
- 80
- 153
-
can you show the relevant code ? – Sandeep Malik Apr 12 '19 at 10:31
-
Possible duplicate of [java.util.Locale has an empty first item](https://stackoverflow.com/questions/14088874/java-util-locale-has-an-empty-first-item) – Srinivasan Sekar Apr 12 '19 at 10:36