What you are looking for is List Item click listener. You can try lv<your listview's obj>.setOnItemCLickListener
below is the example for you.
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(getApplicationContext(),
"Click ListItem Number " + position, Toast.LENGTH_LONG)
.show();
}
});
Follow this basic example
And there is nothing like onClick
to ArrayList
, clicks are set for views.