Reputation: 1094
I just tried this demo, but I can't find how to limit result in country. I also checked getAutocompletePredictions in com.google.android.gms.location.places.GeoDataApi, but I can't found any document to implement limiting country.
I also searched some questions in SO; apparently it's JavaScript and needs to add some "optional param". So how to add optional param in this request?
Upvotes: 5
Views: 3609
Reputation: 519
should be this way, but it doesn't work, due to a bug in google play service library v7?
List<Integer> autocompleteFilter = new ArrayList<Integer>();
autocompleteFilter.add(Place.TYPE_COUNTRY);
// Set up the adapter that will retrieve suggestions from the Places Geo Data API that cover
// the entire world.
mAdapter = new PlaceAutocompleteAdapter(this, android.R.layout.simple_list_item_1,
BOUNDS_JAKARTA, AutocompleteFilter.create(autocompleteFilter));
Upvotes: 0
Reputation: 1889
https://developers.google.com/places/webservice/search
or
2 . add a radius parameter to limit the search
Upvotes: 2