Localities Adapter
You can use this adapter to provide views for an AdapterView. Returns a view for each results returned by LocalitiesService.localitiesAutocomplete and can be used with list-based user interface widgets such as ListView or Spinner.
By default, the array adapter creates a view by calling LocalitiesAutocompleteResponse.description on each autocomplete results and places the result in a TextView. You may also customize what type of view is used for the data object in the collection. To customize what type of view is used for the data object, override LocalitiesAdapter.getView and inflate a view resource.
For an example of using an array adapter with a ListView, see the Adapter Views guide.
Parameters
A grouping of countries to which you would like to restrict your results. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code. For example: fr
or fra
would restrict your results to places within France. (optional) You can use Locale to get proper codes. For example: listOf(Locale.FRANCE.isO3Country, Locale.UK.isO3Country)
Constructors
Properties
This parameter allows to choose the description format for all or some of the suggestion types selected. The custom formats are described as follows (available fields depend on the returned type). For example: mapOf(LocalitiesTypes.Locality to "{name} - {administrative_area_level_0}")
By default, if the parameter is not defined, value is set as LocalitiesService.Data.Standard. The LocalitiesService.Data.Advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter. Please contact us if you are interested in using this parameter and you do not have subscribed the proper option yet.
The language code, using ISO 3166-1 Alpha-2 or Alpha-3 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code
request. For example: Locale.FRANCE.isO3Country
The types of suggestion to return. Not specifying any type will only query LocalitiesTypes.Locality and LocalitiesTypes.PostalCode.