Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add an onClickListener on Default GroupIndicator in ExpandableListView

I'm using Expandable List view. In my app both the group and child have content. So I need to start activity on groupClicked as well as on Child clicked. As the default action (given in android) when I click on a group the group expands.

I want to add a action on the group indicator button. So that, when the group is clicked the activity will start and when the group indicator button is clicked the child will be shown.

 > a group 
     child 1
     child 2...

How can I do that ?

Thank You

like image 769
asish Avatar asked Feb 15 '12 12:02

asish


2 Answers

as far as I know, It is not possible to add any action on default button of expandable list.

like image 163
user1223636 Avatar answered Nov 19 '22 17:11

user1223636


you can set groupIndicator to null and then add a button to your group layout and handle whatever you want on the button onclicklistener

this link may help you to handle multiple listeners on one list item

CustomListView Example

and this one for ExpandableListView:

ExpandableListView Example

like image 26
Amt87 Avatar answered Nov 19 '22 17:11

Amt87