自动填充功能无法正常使用Android

时间:2017-09-29 11:09:34

标签: android android-layout android-fragments google-places

我已将Place Autocomplete添加到我的应用中,但是当我触摸搜索按钮时,它会出现然后消失。我无法输入它消失的搜索。消失意味着有搜索栏,但如果我们触摸谷歌搜索栏就会出来,我们可以在那里打字。但它来了,然后它突然消失了。

这是XML中的代码。


+----+-----+
|hour|count|
+----+-----+
|   0|    1|
|   1|    0|
|   2|    1|
|   3|    0|
|   4|    0|
|   5|    0|
|   6|    0|
|   7|    0|
|   8|    0|
|   9|    0|
|  10|    0|
|  11|    1|
|  12|    0|
|  13|    0|
|  14|    0|
|  15|    0|
|  16|    0|
|  17|    1|
|  18|    4|
|  19|    4|
|  20|    0|
|  21|    1|
|  22|    3|
|  23|    1|
|  24|    0|
+----+-----+

2 个答案:

答案 0 :(得分:0)

它的工作和Android API密钥应该添加到清单!所以它会起作用!https://developers.google.com/places/android-api/

答案 1 :(得分:0)

我遇到了同样的问题。是什么原因导致我的问题是我使用的api是旧的,并没有注册Android项目。 所以我在这里注册了一个新项目https://console.developers.google.com 并用新的api取代旧的api。然后它奏效了。

所以基本上,发生的事情是,当你尝试搜索时,api会被谷歌的服务器拒绝,所以它会阻止你搜索。

相关问题