Click here to Skip to main content
15,885,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi code-maniacs

This is about android locale, why on several devices(phones) the method
Java
Locale.getCountry()
will return "" value ?

I've read android developer about this locale. But there're some point that made me confused :

This class' constructors do no error checking. You can create a Locale for languages and countries that don't exist, and you can create instances for combinations that don't exist (such as "de_US" for "German as spoken in the US").

and

public String getCountry ()
Returns the country code for this locale, or "" if this locale doesn't correspond to a specific country.


Can anyone explain me what's going on in that method?

and how to solve this, because I need that bloody method return my phone locale properly.

--many thanks
sb
Posted

1 solution

Probably, it is becasue you need to get teh actual information first. Have a look here: http://stackoverflow.com/questions/3659809/where-am-i-get-country[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900