I’ve a ListView where every element in the list contains a TextView and two different Buttons. Something like this:
ListView
--------------------
[ImageView][Text][CheckBox][Button]
--------------------
[ImageView][Text][CheckBox][Button]
--------------------
... (and so on) ...
With this code I can create an OnItemClickListener for the whole item:
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> list, View view, int position, long id) {
Log.i(TAG, "onListItemClick: " + position);
}
}
});
However, I don’t want the whole item to be clickable, but only the checkbox and the button of each list element.
So my question is, how do I implement a onClickListener for these two buttons with the following parameters:
int id(some id associated with each item in list)int position(which is the element in the list on which the button click happened)
you need to make baseAdpter to achieve this