Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AutoCompleteTextView如果键盘焦点位于 ACTV 中并且单击了活动中的按钮,我会显示其建议。我似乎能做的最好的事情就是.dismissDropDown()在它出现后打电话,但这似乎很草率。单击按钮时,如何防止它首先出现?
AutoCompleteTextView
.dismissDropDown()
如上所述,这是由于我ArrayAdapter在 ACTV 的适配器中添加了一个元素。我只是继续将新字符串添加到最初ArrayList用于创建的原始字符串中ArrayAdapter,然后创建一个全新的字符串AA并将其设置为 ACTV 的适配器。这种动态更新的方法解决了不应该出现的自动完成列表的问题。
ArrayAdapter
ArrayList
AA