Code example for Geocoder

Methods: getFromLocation

0
	 * @return 
	 */ 
	public static Address getCurrentLocation(final Context context,
			final Locale locale) {
		Address _address = null;
		final Geocoder d = null != locale ? new Geocoder(context, locale)
				: new Geocoder(context);
		try { 
			final Location loc = getCurrentLocation(context);
			final double latitude = loc.getLatitude();
			final double longitude = loc.getLongitude();
			final List<Address> list = d
					.getFromLocation(latitude, longitude, 1);
			if (null != list) {
				for (final Address address : list) {
					_address = address;
					break; 
				} 
			} 
		} catch (final Exception e) {
			if (Log.isLoggable(TAG, Log.ERROR)) {