How to Capture the Click on a Sub-Item in an Expandable List View

0
So pesssoal, I am completing my t.i. course in senai and am developing a CBT for the course. My TCC is an hourly bus line app for my city. So I decided to create an expandable list view by learning a video on youtube, but I'm not able to click on the sub-item in the list (clicked on the desired neighborhood, opened the routes and the user would select which wanted, by your choice would open an activity with the respective schedules of the route chosen), so I needed the help of any of you
asked by anonymous 23.05.2018 / 19:33

1 answer

0

Instead of setOnItemClickListener() you must use setOnChildClickListener () .

Pass the ExpandableListView.OnChildClickListener method.

When implementing your onChildClick () method, use the getChild() of adapter passing groupPosition and childPosition to know which item is clicked.

    
23.05.2018 / 21:31