【发布时间】:2015-07-10 18:44:25
【问题描述】:
我正在尝试在我的应用程序中实现适用于 android 的新 Places API,但我似乎不知道如何为请求设置过滤器。这是我的代码。
LatLng southWest = new LatLng(85, -180);
LatLng northEast = new LatLng(-85, 180);
LatLngBounds bounds = new LatLngBounds(southWest, northEast);
AutocompleteFilter filter = AutocompleteFilter.create(WHAT SHOULD GO HERE?);
PendingResult result = Places.GeoDataApi.getAutocompletePredictions(mGoogleApiClient,
search.getText().toString(), bounds, filter);
如您所见,我遵循了 google here 提供的文档,但我没有谈论如何实现过滤器,在阅读了 API Reference 之后,我仍然无法弄清楚如何实现 API。
我需要帮助来确定 API 的 AutocompleteFilter.create() 参数应该包含哪些内容。我想按城市过滤数据
谢谢
【问题讨论】:
标签: android google-maps autocomplete google-places-api