My custom Listview has more than one button, how can I identify which button has been clicked ? I want to do different things on action of different buttons.
Asked
Active
Viewed 337 times
2 Answers
2
In custom adapder of your ListView you must be creating objects of each button in its getView() method.
Just set the onClickListener on the buttons and perform the action on each buttons in its onClick().
bakriOnFire
- 2,685
- 1
- 15
- 27
1
Create local variables for buttons inside getview method and set onClickListener for each button in a row.
Also have a look at this -: 2 Buttons in ListView in android