得到iso3国家代码
问题描述:
如何获得iso3国家code.when我存储服务器,但它不存储100%的数据库?我使用这些code.Please帮我感谢,并提前...得到iso3国家代码
geocoder = new Geocoder(this);
locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
bestProvider =locationManager.getBestProvider(criteria,false);
location = locationManager.getLastKnownLocation(bestProvider);
if(location!=null)
{
lat=location.getLatitude();
lng=location.getLongitude();
}
else
{
location = new Location("");
location.setLatitude((double)38.0000000000);
location.setLongitude((double)-97.0000000000);
lat =location.getLatitude();
lng=location.getLongitude();
}
Log.e("","Latitude and Longitude"+"Latitude="+lat+"Longitude="+lng);
try
{
addresses=geocoder.getFromLocation(lat,lng, 1);
}
catch (IOException e)
{
e.printStackTrace();
}
if (addresses != null && addresses.size() > 0)
{
Address address = addresses.get(0);
Log.e("Address=",""+address);
locale = address.getCountryCode();
Log.e("Locale",""+locale);
Toast.makeText(SongsList.this, "LocaleName"+locale,Toast.LENGTH_LONG).show();
}
可能重复[获取ISO国家代码(http://*.com/questions/9529285/get -the异国家代码) – 2012-03-02 07:54:40