BasicPlaceAutocomplete.IntentBuilder

public final class BasicPlaceAutocomplete.IntentBuilder


Builder for an intent to launch the activity.

Summary

Public constructors

Public methods

final @NonNull Intent
build(Context context)

Builds the intent to launch the activity.

final @NonNull BasicPlaceAutocomplete.IntentBuilder
setAutocompleteUiCustomization(
    AutocompleteUiCustomization autocompleteUiCustomization
)

Sets the UI customization for the widget.

final @NonNull BasicPlaceAutocomplete.IntentBuilder

Sets countries to restrict results to.

final @NonNull BasicPlaceAutocomplete.IntentBuilder
setInitialQuery(String initialQuery)

Sets the initial query in the search input.

final @NonNull BasicPlaceAutocomplete.IntentBuilder

Biases the autocomplete results to a particular area.

final @NonNull BasicPlaceAutocomplete.IntentBuilder

Restricts the autocomplete results to a particular area.

final @NonNull BasicPlaceAutocomplete.IntentBuilder
setOrigin(LatLng origin)

Sets the origin of the autocomplete request.

final @NonNull BasicPlaceAutocomplete.IntentBuilder
setPureServiceAreaBusinessesIncluded(
    boolean isPureServiceAreaBusinessesIncluded
)

Sets whether to include pure service area businesses in the results.

final @NonNull BasicPlaceAutocomplete.IntentBuilder
setRegionCode(String regionCode)

Sets the unicode country/region code (CLDR) of the location where the request is coming from.

final @NonNull BasicPlaceAutocomplete.IntentBuilder

Sets the filter that restricts the type(s) of results returned from the response.

Public constructors

IntentBuilder

public IntentBuilder()

Public methods

build

public final @NonNull Intent build(Context context)

Builds the intent to launch the activity.

setAutocompleteUiCustomization

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setAutocompleteUiCustomization(
    AutocompleteUiCustomization autocompleteUiCustomization
)

Sets the UI customization for the widget.

setCountries

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setCountries(List<@NonNull 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. Up to five countries are supported.

setInitialQuery

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setInitialQuery(String initialQuery)

Sets the initial query in the search input.

setLocationBias

public final @NonNull BasicPlaceAutocomplete.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.

setLocationRestriction

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setLocationRestriction(LocationRestriction locationRestriction)

Restricts the autocomplete results to a particular area.

setOrigin

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setOrigin(LatLng origin)

Sets the origin of the autocomplete request.

setPureServiceAreaBusinessesIncluded

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setPureServiceAreaBusinessesIncluded(
    boolean isPureServiceAreaBusinessesIncluded
)

Sets whether to include pure service area businesses in the results.

setRegionCode

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setRegionCode(String regionCode)

Sets the unicode country/region code (CLDR) of the location where the request is coming from.

setTypesFilter

public final @NonNull BasicPlaceAutocomplete.IntentBuilder setTypesFilter(List<@NonNull String> typesFilter)

Sets the filter that restricts the type(s) of results returned from the response.

Up to 5 place types are supported. The full list can be found here, and should be considered as the source of truth. 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.