我想在我的应用程序中获取android设备中当前位置的邮政编码,任何示例或定位它的代码片段。我已经尝试过地理编码器,它只给出经纬度位置。
发布于 2011-12-09 14:59:03
很明显你没有正确地使用它...
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
// lat,lng, your current location
List<Address> addresses = geocoder.getFromLocation(lat, lng, 1); 现在,Address列表包含了最近的已知区域。Address对象具有getPostalCode()函数。抓取第一个对象并找到它的邮政编码。
这就对了。
https://stackoverflow.com/questions/8442050
复制相似问题