Hi everyone,
I am using the Geocoder.getFromLocation(lat,lon,1) and it seems that a
lot of the time nothing gets returned to the List<Address> array
sometimes it works as it is suppose to. Is there a better way to get
the city/state from the lat/lon that is more reliable? the code I use
is below:
Geocoder gc = new Geocoder(this, Locale.getDefault());
List<Address> addresses = null;
addresses = gc.getFromLocation(lat,
lon, 10);
cityState =
addresses.get(0).getLocality();
stateAbrv =
addresses.get(0).getAdminArea();
When it doesn't work it is because addresses is null
Thanks in advance for the help,tips, and/or advice,
Tommy
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en