I\'ve a ListView
where every element in the list contains a TextView and two different Buttons. Something like this:
ListView
------------------
The solution to this is actually easier than I thought. You can simply add in your custom adapter's getView()
method a setOnClickListener() for the buttons you're using.
Any data associated with the button has to be added with myButton.setTag()
in the getView()
and can be accessed in the onClickListener via view.getTag()
I posted a detailed solution on my blog as a tutorial.