OnScrollListener.onScroll () caused by clicking an item in a ListView

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

Is there a way to prevent this behavior? If not, how can I say inside onScroll() if the user really scrolls or just clicks?

+4
source share
1 answer

I think onScrollStateChanged should also be called with scrolling. Then you need to make sure that the state is in standby mode or scrolls through the constants defined in OnScrollListener . As an example, consider this section .

+2
source

Source: https://habr.com/ru/post/1400966/


All Articles