Code example for Location

Methods: getLatitudegetLongitudetoString

0
	} 
	private void logAddressLine(int index, String line){
		Log.d(getTag(), "AddressLine[" + String.valueOf(index) + "]=" + line);
	} 
	private List<Address> getAddressesFromLocation(Location location){
		double lat = location.getLatitude();
		double lng = location.getLongitude();
		List<Address> list;
		 
		try { 
			list = getAddressesFromLatAndLng(lat, lng);
		} catch (IOException e) {
			e.printStackTrace();
			logIOException(location);
			list = new ArrayList<Address>();
		} 
		return list;
	} 
	private List<Address> getAddressesFromLatAndLng(double lat, double lng) throws IOException{
		List<Address> list;
		 
		list = this.geocoder.getFromLocation(lat, lng, 5);
		return list;
	} 
	private void logIOException(Location location){
		Log.e(getTag(), "Could not get addresses for " + location.toString());
	} 
}