On Tue, Mar 23, 2010 at 6:16 PM, Sergio Visinoni <sergio.visin...@gmail.com>wrote:
> Hi all, > > I'm having a problem calling GeoCoder.getFromLocation(); > > I have a LocationListener calling an updateLocation() method in my > class, which in turns > calls GeoCoder.getFromLocation() with the current location. > > ==== > private void updateLocation(Location currentLocation) { > if (currentLocation != null) { > Geocoder geoCoder = new Geocoder(this); > > try { > addressList = > geoCoder.getFromLocation(currentLocation.getLatitude(), > currentLocation.getLongitude(), 1); > } catch (IOException ioException) { > Log.v(TAG, "Error getting address"); > return; > } > > ==== > > When I run this code on a device (HTC Magic 1.6) I get the following error > : > > D/LocationMasfClient(15392): getAddressFromProtoBuf(): Ignore feature > 0,1er Arrondissement Paris > D/AndroidRuntime(21403): Shutting down VM > W/dalvikvm(21403): threadid=3: thread exiting with uncaught exception > (group=0x4001da38) > E/AndroidRuntime(21403): Uncaught handler: thread main exiting due to > uncaught exception > I don't think this is the full exception back trace. There might be more explaining the exact exception caught. > If I run the same code on an emulator (1.6 with google api) the error I get > is : > > D/GpsLocationProvider( 52): setMinTime 0 > E/LocationMasfClient( 52): reverseGeocode(): no feature in GLocation > > Am I doing something wrong? Does anyone have the same problem or a > solution for this kind of issue? > Geocoding might fail as explained in http://developer.android.com/reference/android/location/Geocoder.html#getFromLocation(double,%20double,%20int). You might want to check for null. -- Ning -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.