Android:Google商家信息自动填充 - 如何使用它来填充RecyclerView而不是下拉菜单?

Geo*_*ang 9 android google-places-api

如您所知,Google Places API允许您输入搜索框并在下拉菜单中获取建议的地址.

在大多数示例中,我看到人们将Google Places API与AutoCompleteTextView一起使用,以便在下拉列表中显示自动填充建议.我真正想要的是填写RecyclerView的建议.这样做的正确方法是什么?

Ste*_*tes 0

您可以使用 GeoDataApi.getAutocompletePredictions 然后以您希望的方式显示这些结果(即在您的回收视图中)

请参阅https://developers.google.com/places/android-api/autocomplete#get_place_predictions_programmatically了解说明