Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OnScrollListener.onScroll() called on item click in a ListView

I have a ListView with an OnScrollListener and an OnItemClickListener. When I click on an item, both the onScroll() method in the OnScrollListener and the OnItemClickListener are fired.

Is there a way to prevent this behaviour? If not, how can I tell, inside onScroll(), if the user is really scrolling or he's just clicking?

like image 421
Venator85 Avatar asked Nov 05 '22 03:11

Venator85


1 Answers

I think onScrollStateChanged should also be called with scrolling. Then you should be able to see if the state is idled or scrolling through the constants defined in OnScrollListener. Check this topic for an example.

like image 79
Sephy Avatar answered Nov 29 '22 08:11

Sephy