How to disable AutoCompleteTextView's drop-down from showing up?

前端 未结 17 2011
终归单人心
终归单人心 2020-12-05 15:30

I use the following code to set text to an AutoCompleteTextView field. But I noticed that when I set certain text (not all text, but some) to it, it will automatically pop u

17条回答
  •  孤街浪徒
    2020-12-05 15:51

    Another solution is to clear the focus before setting the text:

    mContactTxt.setFocusable(false);
    mContactTxt.setFocusableInTouchMode(false);
    mContactTxt.setText("");            
    mContactTxt.setFocusable(true);
    mContactTxt.setFocusableInTouchMode(true);
    

提交回复
热议问题