When I use call getFromLocationName I get an IOException with description \"grpc failed\".
Code that\'s ran
@Override
public void onMapReady(GoogleMa
SomeTimes Geocoder failed when latitude and longitude contain above 3 decimal places, or it may be said that Geocoder can not decode every latitude and longitude. you need to limit latitude and longitude upto 3 decimal places. complete code
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(3);
double lat = Double.parseDouble(df.format(currentUserLocation.latitude));
double lon =
Double.parseDouble(df.format(currentUserLocation.longitude));
Geocoder geocoder = new Geocoder(myContext, Locale.getDefault());
List addresses = geocoder.getFromLocation(lat,lon, 1);
String cityName = addresses.get(0).getLocality();