【问题标题】:Android: Google Places Autocomplete- How can I use it to fill a RecyclerView rather than a Dropdown Menu?Android:Google Places Autocomplete-如何使用它来填充 RecyclerView 而不是下拉菜单?
【发布时间】:2015-11-12 01:09:14
【问题描述】:

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

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

【问题讨论】:

  • 我找到了这个示例代码,希望对您有所帮助我只是在探索samplecode

标签: android google-places-api


【解决方案1】:

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

有关说明,请参阅 https://developers.google.com/places/android-api/autocomplete#get_place_predictions_programmatically

【讨论】:

    猜你喜欢
    • 2017-01-30
    • 1970-01-01
    • 2018-02-18
    • 1970-01-01
    • 1970-01-01
    • 2016-08-15
    • 2011-12-15
    • 2013-08-23
    • 2020-11-20
    相关资源
    最近更新 更多