Disable Android AutoCompleteTextView after user selects item from drop down

前端 未结 5 1133
北海茫月
北海茫月 2021-02-07 06:47

I\'m using Android\'s AutoCompleteTextView with a CursorAdapter to add autocomplete to an app. In the view\'s onItemClickListener() (i.e.

5条回答
  •  半阙折子戏
    2021-02-07 07:33

    Different approach. I agreed dismissDropDown() works but in my case, it wasn't working as expected. So, I used:

    autoCompleteTextView.setDropDownHeight(0);
    

    And if you want to show the dropdown list again, you an use

    autoCompleteTextView.setDropDownHeight(intValue);
    

提交回复
热议问题