开发者

Android AutoCompleteTextView displays suggestions after unrelated button is clicked

I am having an issue where my AutoCompleteTextView is showing its suggestions if keyboard focus is in the ACTV and a button in the activity is clicked. The best I can seem to do is call .dismissDropDown() after it appears, but that seems sl开发者_开发技巧oppy. How can I keep it from appearing in the first place when the button is clicked?


As mentioned above, this was due to me adding an element to the ArrayAdapter adapter of the ACTV. I just went ahead and added the new string to the original ArrayList used for initially creating the ArrayAdapter, then created a completely new AA and set that as the ACTV's adapter. That method of dynamic updating fixed the problem of the autocomplete list appearing when it wasn't supposed to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜