I have a list view where items have a text view and a button. I have managed to make list view onclick and button on click work together. The problem is that when I click the button I don’t really know what list view item index it belongs too. Is there any way to know that? I need this to pass it to a “CRUD” for editing, etc…
Share
You can use setTag and getTag here to get the position of the Button Clicked in the ListView,
Something like,
button.setTag(position);// in your getView() methodand then,
int cur_pos = (Integer)v.getTag();// inside onClick of Button in getView() method