Possible Duplicate:
setOnItemClickListener not getting called
I have a custom adapter which extends base adapter. When I set setOnItemClickListener in onCreate and implement onItemClick I'm getting no response when I click on a row.
ListView lv = (ListView)findViewById(R.id.list);
adapter = new ModuleAdapter(this);
lv.setAdapter(adapter);
lv.setOnItemClickListener(this);
after onCreate:
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Log.v(TAG, "clicked");
}
There are only text views in my rows. Can anyone help please?
If you want to use
you must implement OnItemClick listener to your Activity.
and also you can use @user1597833 's answer.
if you want to click textview not cell, try @jeet 's answer.
It seems views in the row item view, has focusable and clickable property true, so child of item take click event, instead of list row item, if it is the case, to solve this issue, change all view's of row item's focusable, and clickable property to false.