Android 4.x getting city from location

view story

http://stackoverflow.com – I'm writing a simple app and I wanted to implement something to get a city name from GPS location. I followed this example: Get city name from location I also added a network provider if GPS is not available. Something like this: Location location = lm .getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location == null) { location = lm .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); } Then I call getCityFromLocation(location); Method getLastKnownLocation: private void getCityFromLocation(Location location) { if (locat (HowTos)