Builder for an intent to launch the autocomplete activity.
Public Constructor Summary
IntentBuilder(AutocompleteActivityMode mode, List<Place.Field> placeFields)
Creates a new builder for an intent to launch the autocomplete activity.
|
Public Method Summary
Intent | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder |
setLocationRestriction(LocationRestriction locationRestriction)
Restricts the autocomplete results to a particular area.
|
Autocomplete.IntentBuilder |
setRegionCode(String regionCode)
Sets the unicode country/region code (CLDR) of the location where the request is coming from.
|
Autocomplete.IntentBuilder | |
Autocomplete.IntentBuilder |
setTypesFilter(List<String> placeTypes)
Sets the filter that restricts the type(s) of results returned from the response
Up to 5 place types are supported. |
Inherited Method Summary
Public Constructors
public IntentBuilder (AutocompleteActivityMode mode, List<Place.Field> placeFields)
Creates a new builder for an intent to launch the autocomplete activity.
Parameters
mode | the display mode of the autocomplete activity. |
---|---|
placeFields | the fields of the place to be requested. See Place.Field for the
specifiable fields. Read more about Place
Data Fields.
|
Public Methods
public Autocomplete.IntentBuilder setCountries (String... countries)
See setCountries(List)
.
Parameters
countries |
---|
public Autocomplete.IntentBuilder setCountries (List<String> countries)
Sets countries to restrict results to.
This must be a list of ISO 3166-1 Alpha-2 country codes (case insensitive). If no countries are set, no country filtering will take place.
This will override values set with setCountry(String)
.
Up to five countries are supported. See the components
parameter here.
Parameters
countries |
---|
public Autocomplete.IntentBuilder setCountry (String country)
This method is deprecated.
Use setCountries(List)
instead.
See setCountries(String...)
for details.
This will override countries set with setCountries(String...)
.
Parameters
country |
---|
public Autocomplete.IntentBuilder setHint (String hint)
Sets the hint text to display in the search input field when there is no text entered.
If the hint is unset or explicitly set to null, the hint text will be set to the default value.
Parameters
hint |
---|
public Autocomplete.IntentBuilder setInitialQuery (String initialQuery)
Sets the initial query in the search input.
Parameters
initialQuery |
---|
public Autocomplete.IntentBuilder setLocationBias (LocationBias locationBias)
Biases the autocomplete results to a particular area.
If the bounds are unset or explicitly set to null, the autocomplete results will be biased to the device's approximate location.
Parameters
locationBias |
---|
public Autocomplete.IntentBuilder setLocationRestriction (LocationRestriction locationRestriction)
Restricts the autocomplete results to a particular area.
Parameters
locationRestriction |
---|
public Autocomplete.IntentBuilder setRegionCode (String regionCode)
Sets the unicode country/region code (CLDR) of the location where the request is coming from.
The region code field is only supported by Places API (New). Please enable your API key for the Places API (New) in the Google Cloud Console to use region code. If you do not enable your API key for the Places API (New), the region code will not affect the results.
Parameters
regionCode |
---|
public Autocomplete.IntentBuilder setTypeFilter (TypeFilter typeFilter)
This method is deprecated.
Use setTypesFilter(List)
.
Filters the autocomplete results to the given place type.
Parameters
typeFilter |
---|
public Autocomplete.IntentBuilder setTypesFilter (List<String> placeTypes)
Sets the filter that restricts the type(s) of results returned from the response
Up to 5 place types are supported. A comprehensive list of the supported types can be
found in PlaceTypes
. The type
collections specified in table 3 must be passed in as solo entries and cannot be combined
with any other entries from table 1 or 2.
This will override setTypeFilter(TypeFilter)
if both are used.
Parameters
placeTypes |
---|