Show all items in AutocompleteTextView without writing text

前端 未结 12 800
萌比男神i
萌比男神i 2020-12-29 01:05

I have a AutocompleteTextView and it works fine. When I write a word it shows the relevant result but I want to show all items without writing any word in AutocompleteTextVi

12条回答
  •  温柔的废话
    2020-12-29 01:49

    I got a great solution to this. It's simple. This is just the drop-down and choosing from the options.

    Make sure you add these two lines to XML.

    android:completionThreshold="0" android:focusableInTouchMode="false"

    XML

    
    
        
    
    
    

    JAVA

    area_autocomplete.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            area.showDropDown();
        }
    });
    

提交回复
热议问题