public class

PlaceAutocompleteFragment

extends Fragment
java.lang.Object
   ↳ android.app.Fragment
     ↳ com.google.android.gms.location.places.ui.PlaceAutocompleteFragment

Class Overview

A fragment that provides auto-completion for places.

Use this class only if you are targeting API 12 and above. Otherwise, use SupportPlaceAutocompleteFragment.

Summary

[Expand]
Inherited Constants
From interface android.content.ComponentCallbacks2
Public Constructors
PlaceAutocompleteFragment()
Public Methods
void setBoundsBias(LatLngBounds bounds)
Biases the autocomplete results to a particular area.
void setFilter(AutocompleteFilter filter)
Sets a filter on autocomplete predictions.
void setHint(CharSequence hint)
Sets the hint text to display in the search input field when there is no text entered.
void setOnPlaceSelectedListener(PlaceSelectionListener listener)
Sets a listener that will be notified when a place is selected.
void setText(CharSequence text)
Sets the text to display in the search input field.
[Expand]
Inherited Methods
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Public Constructors

public PlaceAutocompleteFragment ()

Public Methods

public void setBoundsBias (LatLngBounds bounds)

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
bounds LatLngBounds: A LatLngBounds object that defines a geographical area using two sets of latitude/longitude coordinates marking the top left and bottom right corners.

public void setFilter (AutocompleteFilter filter)

Sets a filter on autocomplete predictions.

Parameters
filter AutocompleteFilter: A filter to use for restricting the returned predictions. If null, a filter with no constraints will be used.

public void setHint (CharSequence hint)

Sets the hint text to display in the search input field when there is no text entered.

Parameters
hint CharSequence

public void setOnPlaceSelectedListener (PlaceSelectionListener listener)

Sets a listener that will be notified when a place is selected.

Parameters
listener PlaceSelectionListener: The listener that should be notified.

public void setText (CharSequence text)

Sets the text to display in the search input field.

Parameters
text CharSequence