Search code examples
androidadaptercustomizationautocompletetextviewandroid-chips

Custom AutoCompleteTextView with custom Adapter for DropDown ignoring onItemClick


So I made a custom AutoCompleteTextView and a custom Adapter. Everything works as long as I use TextView to display data in the dropdown, the click event gets triggered and the TextView gets filled with the selected text. So far so good.

Troubles arises when I use a ChipGroup which then gets filled with Chips in the Adapter. At that point onItemClick doesn't get triggered anymore. My guess is that something is intercepting the click event without passing it down the tree to the AutoCompleteTextView.

Any help would be really appreciated. Thank you!


Solution

  • The solution for me has been to set those attributes for the Chip:

    isClickable = false
    isFocusable = false
    isFocusableInTouchMode = false
    setOnCheckedChangeListener(null)
    

    I hope that helps somebody!