1

getfromlocation always return ioexception. I have a internet permission in manifiest, try in emulator, in 2.3 device and 4.0 device..always the same result.

This is the code

while (it.hasNext()) {

            Tienda temp = (Tienda) it.next();
            double latitud = Double.parseDouble(temp.latitud.toString());
            double longitud = Double.parseDouble(temp.longitud.toString());
             nombre = temp.nombre;
            GeoPoint punto = new GeoPoint((int)(latitud*1e6), (int)(longitud*1e6));

            try {
              Geocoder geocoder = new Geocoder(this, Locale.getDefault());
              List<Address> addresses = geocoder.getFromLocation(latitud, latitud, 1);
              StringBuilder sb = new StringBuilder();
              if (addresses.size() > 0)
              {
                Address address = addresses.get(0);
                sb.append(address.getLocality()).append("\n");
                sb.append(address.getCountryName());
              }
              addressString = sb.toString();

              Log.e("Address from lat,long ;", addressString);
             }catch (IOException e){

             }

            CustomOverlayItem overlayItem = new CustomOverlayItem(punto, nombre,addressString,"http://ia.media-imdb.com/images/M/MV5BMTM1MTk2ODQxNV5BMl5BanBnXkFtZTcwOTY5MDg0NA@@._V1._SX40_CR0,0,40,54_.jpg");
            itemizedOverlay.addOverlay(overlayItem);                        
            mapOverlays.add(itemizedOverlay);
        }  

I tried with different codes but dont work..

colymore
  • 11,776
  • 13
  • 48
  • 90

0 Answers0