【发布时间】:2012-08-16 21:45:47
【问题描述】:
我从堆栈溢出中解决了许多问题并实施了上述过程。但我无法获得地址。如果我错过了什么,请告诉我..? myLoc = (TextView) findViewById(R.id.id1);
Geocoder geocoder = new Geocoder(getBaseContext(),Locale.getDefault());
try {
address = geocoder.getFromLocation(latitude, longitude, 1);
if (address.size() > 0) {
for (int i = 0; i < address.get(0)
.getMaxAddressLineIndex(); i++) {
display = "";
display += address.get(0).getAddressLine(i)
+ "\n";
}
}
} catch (Exception e2) {
// TODO: handle exception
}
myLoc.setText("Current Location:"+display);
System.out.println(display);
【问题讨论】:
标签: android google-maps android-emulator reverse-geocoding