How to force AutoCompleteTextView to update height of drop-down?
-
13-10-2019 - |
Question
I have an AutoCompleteTextView
in my app that connects to a remote site to fetch suggestions. While suggestions are fetched I show a list of one item saying "searching, please wait". After the request completes, I update the suggestion list adapter and call notifyDataSetChanged
.
Then the list contents changes to new suggestions (as expected), but somehow the list remains 1 cell in height, so that only the top suggestion is visible. How to force the view to re-calculate the dropdown height?
Solution
It seems that showDropDown()
forces re-evaluation of the suggestion list height. Unfortunately, it also forces it to show, but for my purposes it was acceptable.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow