views:

46

answers:

2

The default behavior of ExpandableListView is to collapse a group when its header is clicked. Is it possible to prevent this from happening?

I've tried:

  • Setting OnTouchListener on the list. This interferes with scrolling.
  • Setting an OnGroupClickListener on the list (in onCreate()). This works for all clicks after the first.

Has anyone else accomplished this? Why might the OnGroupClickListener miss the first click?

Thanks in advance for your suggestions.

A: 

It seems the problem had to do with there being both a focusable element in the group header and an OnGroupClickListener set. Removing the listener solved my problem.

Justin
didn't solve it for me (I hadn't even set one in the first place). I have clickable elements *inside* the header, but the header itself should not be clickable.
Matthias