How to filter by city in Google Place Autocomplete?

0

I am using it in a EditText Google Place Autocomplete , to search the streets of a city, for the moment I filter it by Country in the following way:

AutocompleteFilter autocompleteFilter = new 
AutocompleteFilter.Builder() **.setTypeFilter(Place.TYPE_COUNTRY) 
.setCountry("AR")** .build();* 

But I need this search to be even more filtered, be it for a specific city, try to do it with TYPE_POSTAL_CODE but I can not implement it.

    
asked by Yamil Lazzari 26.11.2018 в 16:15
source

1 answer

0

If you want to restrict the result set of a request to cities.

use the constant:

  

TYPE_FILTER_CITIES : Returns any result that matches the following types of places:

     
  • TYPE_LOCALITY
  •   
  • TYPE_ADMINISTRATIVE_AREA_LEVEL_3
  •   

example:

setTypeFilter(Place.TYPE_FILTER_CITIES) 

Valid values for setTypeFilter () are:

answered by 26.11.2018 в 23:54