How to identify button click in getChildView of ExpandableListView in android -
I am creating ExpandableListView in my Android app. I have created a hair xml layout that repeats to specific numbers. My XML layout has a delete button that is set in the form of BDDLELAT in XML. By clicking the delete button I want to delete a specific child.
Example:
Group:
remove hair 1 hair 2 remove chili 3 code> Now my problem is how to identify which child's delete button is clicked. Since all the delete buttons are the same ID in my XML layout, please suggest me a solution.
In your adapter, where you inflate your line layout, you can set a tag ( With setTag () method) on each Delete button. The tag can be the position of the row that matches this delete button. Later, when someone clicks the button, in the onClickListener , you get the button tag ( V.getTag () ), that Delete the integer and the row in position.
Comments
Post a Comment