我已经能够获得lat和long,但有没有办法对本地邮政编码进行粗略猜测?
我需要这个在英国工作。
如果无法做到这一点,请说出来。
答案 0 :(得分:2)
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);
邮政编码(美国的邮政编码),如果有的话,是:
final String postalCode = addresses.get(0).getPostalCode();
(找到here.)