1
listView.setAdapter(adapter);

listView.setOnScrollListener(this);
listView.setOnItemClickListener(this);

I have listView on fragment, custom adapter and I want to set 2 listeners on it, but when I added setOnScrollListenerfirst listener doesn't work. What's wrong? and how can I fix it?

Gorets
  • 2,434
  • 5
  • 27
  • 45
  • what exactly does not work? the onScrollListener or the onItemClickListener? How do you verify that they are not working? Can you reveal some more code/info – peshkira Feb 10 '14 at 13:38
  • I tried to debug it, when I tap on item a 'onItemClick' method doesnt call at all – Gorets Feb 10 '14 at 13:40
  • please help, i think the problem in overrided onClick method by OnScrollListener – Gorets Feb 11 '14 at 08:35
  • I'll need some more info. Maybe you can share some more of the relevant portions of the code. OnScrollListener does not have onClick, so it cannot override it, if I understand correctly what you mean – peshkira Feb 11 '14 at 10:02
  • 1
    i found solution, i just implement OnClickListener in adapter and OnScrollListener in activity this is work well, but why this listeners doesnt (setOnScrollListener and setOnItemClickListener) works together in activity i dont know – Gorets Feb 11 '14 at 10:14

1 Answers1

0

I had the same problem, which seemed to be caused by a misplaced adapter.notifyDataSetChanged() call. Removing this line fixed the problem, as it turned out I didn't need it anyway.

zyzof
  • 3,415
  • 1
  • 25
  • 21