Android: AutoCompleteTextView show suggestions when no text entered

后端 未结 14 1933
-上瘾入骨i
-上瘾入骨i 2020-11-27 11:20

I am using AutoCompleteTextView, when the user clicks on it, I want to show suggestions even if it has no text - but setThreshold(0) works exactly

14条回答
  •  长情又很酷
    2020-11-27 12:02

    You can use onFocusChangeListener;

    TCKimlikNo.setOnFocusChangeListener(new OnFocusChangeListener() {
    
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    TCKimlikNo.showDropDown();
    
                }
    
            }
        });
    

提交回复
热议问题