If I add an EditText to ExpandableListView in item , which is at the top level, then the drop-down list stops working by clicking on this item . Somehow you can do what would the drop-down list continued to work further? Or in ExpandableListView it is impossible to add EditText ?

    1 answer 1

    You can turn off the focus on EditText and turn it on while typing:

     editText.setFocusable(false); editText.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { editText.setFocusableInTouchMode(true); return false; } }); editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { editText.setFocusable(false); editText.setFocusableInTouchMode(false); } }); 

    But all the same, instead of EditText, it is better to make a TextView and Button / ImageButton, which, when pressed, calls the text editing dialog. Just do not forget to set Button android:focusable="false" , otherwise ExpandableListView will not be expanded either.

    • it helped, but probably it’s really better to do a TextView - Lucky_girl