views:

2121

answers:

2

I have Implemented a custom ListView by extending LinearLayout for every row. Every row has a small thumbnail, a text and a check box. The list view is deployed properly and I can scroll and fling through it without any problems.

But The ListView doesn't seem to respond to the setOnItemClickListener() at all, So I had to find a workaround by setting click listener in the getView of the Text inside every row which is obviously creating problem when I am trying to reuse the adapter. Does anyone have a solution?

+2  A: 

Try this
For ListView,

final ListView list = (ListView) findViewById(R.id.list);
list.setItemsCanFocus(false);

Also, make sure that for CheckBox inside list item set focusable false

android:focusable="false"
android:focusableInTouchMode="false"
bhatt4982
I'm having the same problem, the above solution works for detecting clicks on the row but I have 2 buttons in my custom ListView row. How can I tell which button was clicked?Thanks
longhairedsi
A: 

I have had a lot of problems with this. After setting these properties to false for all elements inside each row it works!

Thanks!

Oscar