2013년 2월 26일 화요일

get city name without open api


private void getCityName(double mLat, double mLong) {


String result = null;
Geocoder mGeoCoder = new Geocoder(this, Locale.KOREA);

try {
List<Address> addrs = mGeoCoder.getFromLocation(mLat, mLong, 1);
Address address = addrs.get(0);
result = address.getLocality();
} catch (IOException e) {
}

Toast.makeText(this, result, Toast.LENGTH_LONG).show();

}

댓글 없음:

댓글 쓰기