I am using the Google Maps API v2 for Android and working correctly. However, I am trying to use a geocoder to get the longitude and latitude of the address, but to no avail.
Has he changed the way to do this from v2?
I use regular code
Geocoder gc = new Geocoder(context); //... List<Address> list = gc.getFromLocationName("1600 Amphitheatre Parkway, Mountain View, CA", 1); Address address = list.get(0); double lat = address.getLatitude(); double lng = address.getLongitude(); //...
Always returns a forced termination, but Log does not solve anything. When using the try / catch block, a map opens, but always with the same location. Use Internet permission, I also included COARSE_LOCATION in the project. I used various codes located here and on other sites, but without success.
Thanks in advance.
android maps google-maps android-maps-v2
Sergio76 Mar 29 '13 at 21:13 2013-03-29 21:13
source share