Hi,

The way it works is that if your list item (or a part of your list item) is 
clickable (like the button) it will "steal" the touch event from the ListView, 
so the ListView will not be able to call onItemClick().

One way to solve it is to set a click listener to the button in each item view. 
This can be done from the adaptor. Though you need to make sure you don't leak 
listeners. You can for example set the same listener to all items and figure 
out exactly what item was pressed by tagging the item-views with the position, 
and then checking the tag in the onClick() callback.

/Anders

-----Original Message-----
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of prachi
Sent: den 3 juni 2010 15:58
To: Android Developers
Subject: [android-developers] how to enable onItemClick for custom list view

Hey hiii allllll


I hav a list view,each list item has a text view and a button.

My onItemClick() for list item is not responding.But if i remove the
button from list item it is responding..........

Plzzzz helppp bcoz i want both to function  :(:(:(


Any help would be appreciated:):):)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to