Do ExpandableListView list item "press" behaviors have to be wired up by the developer?

559 Views Asked by At

I have an Activity that uses a layout that contains a TextView, an ImageButton, and an ExpandableListView. As far as I can tell, there are no default views for ExpandableListView's group and child views. As such, the cursor adapter I provide to ExpandableListView is a subclass of CursorTreeAdapter that overrides newGroupView() and newChildView(). The group view contains a TextView and an ImageButton. The child view contains a TextView and a RatingBar.

Is there anything special I need to do to (1) have the behavior where pressing a group item in the list causes the item's background to turn the default Android yellow/orange (2) have the group expand to show the children when the group item is pressed.

I thought these 2 behaviors were built into the ExpandableListView and didn't require any sort of special wiring up by the developer. Is this incorrect?

Thanks.

1

There are 1 best solutions below

0
Julian A. On BEST ANSWER

Discovered the problem was caused by having focusable views within my custom ExpandableListView group view. It was further complicated by using an ImageButton. See here for a solution