This class is deprecated.
Use AutocompleteSupportFragment
instead. This implementation has known bugs
that are not fixable without the support library.
A fragment that provides auto-completion for places.
Use this class only if you are embedding this fragment in an Activity
. For embedding
in a FragmentActivity
, use AutocompleteSupportFragment
.
Inherited Constant Summary
Public Constructor Summary
Public Method Summary
void |
onActivityResult(int requestCode, int resultCode, Intent data)
|
View | |
void | |
void | |
void |
setHint(CharSequence hint)
Sets the hint text to display in the search input field when there is no text entered.
|
void | |
void |
setLocationRestriction(LocationRestriction locationRestriction)
Restricts the autocomplete results to a particular area.
|
void |
setOnPlaceSelectedListener(PlaceSelectionListener listener)
Sets a listener that will be notified when a place is selected.
|
void |
setPlaceFields(List<Place.Field> placeFields)
Sets the desired fields of the
Place object returned from selecting an autocomplete
result. |
void | |
void |
Inherited Method Summary
Public Constructors
public AutocompleteFragment ()
Public Methods
public void onActivityResult (int requestCode, int resultCode, Intent data)
Parameters
requestCode | |
---|---|
resultCode | |
data |
public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Parameters
inflater | |
---|---|
container | |
savedInstanceState |
public void onDestroyView ()
public void setCountry (String country)
Restricts the autocomplete results to a particular country.
Parameters
country |
---|
public void setHint (CharSequence 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 void setLocationBias (LocationBias locationBias)
Biases the autocomplete results to a particular area.
Parameters
locationBias |
---|
public void setLocationRestriction (LocationRestriction locationRestriction)
Restricts the autocomplete results to a particular area.
Parameters
locationRestriction |
---|
public void setOnPlaceSelectedListener (PlaceSelectionListener listener)
Sets a listener that will be notified when a place is selected.
Parameters
listener | The listener that should be notified. |
---|
public void setPlaceFields (List<Place.Field> placeFields)
Sets the desired fields of the Place
object returned from selecting an autocomplete
result.
Read more about Place Data Fields.
Parameters
placeFields |
---|
public void setText (CharSequence text)
Sets the text to display in the search input field.
Parameters
text |
---|
public void setTypeFilter (TypeFilter typeFilter)
Restricts the autocomplete results to the given place type.
Parameters
typeFilter |
---|