2

I have a ListActivty and I overload the onListItemClick(ListView listView, View view, int position, long id) in my List Activity.

My question is why onListItemClick() not getting called back (i have breakpoint in my debugger) when I have an ImageButton in my list item view (the one view created by my list adaptor from cursor)?

Thank you.

michael
  • 106,540
  • 116
  • 246
  • 346
  • Are you clicking on the button or on the listview row. You might want to implement a click handler for your button too. – Pentium10 Jul 16 '10 at 18:33
  • I am clicking on the listview, but the method onListItemClick(ListView listView, View view, int position, long id) is not getting called back. – michael Jul 16 '10 at 19:19

1 Answers1

4

Is the button's click occurring, but not the list item? This might be a focus problem where the button is taking the focus away from the list item. Try setting myImageButton.setFocusable(false);

Aurora
  • 4,384
  • 3
  • 34
  • 44
  • I am also having this problem for my list with image buttons. I set myImageButton.setFocusable(false); but still not getting the event. Plz can anyone suggest the way to get the event.. – Panache Jul 26 '11 at 16:45