0

I have a Custom ListView, in the List there is 3 ImageView and 4 Textview . I can not tap on the List Items and I am able to tap on the blank spcae. So what to do to tap on the List item and the onClick Listener should work ?

Th0rndike
  • 3,406
  • 3
  • 22
  • 42
Subrat
  • 3,928
  • 6
  • 39
  • 48
  • Do you have a custom adapter as well? – Th0rndike Apr 16 '12 at 14:07
  • put this in your code and see what it does...: @Override public void onListItemClick(ListView l, View v, int position, long id) { Log.i(this.getClass().getSimpleName(), " ->" + Thread.currentThread().getStackTrace()[2].getMethodName()); } Does it debug when you tap on a list item? – user387184 Apr 16 '12 at 14:08
  • 1
    why don't you post code so we can see what you are potentially doing wrong? – dymmeh Apr 16 '12 at 14:09
  • @Th0rndike yes using custom adapter – Subrat Apr 16 '12 at 15:13

1 Answers1

3

If there are clickable views in your list cells, you must set these wiews not focusable (in code, after setting your onClickListeners) for the cell to be clickable as well by calling :

myCellButton.setOnClickListener(buttonClickListener);
myCellButton.setFocusable(false);
Tchettane
  • 336
  • 2
  • 5