Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementation of onScrollListener to detect the end of scrolling in a ListView
    primarykey
    data
    text
    <p>I've a <code>ListView</code> displaying some items. I'd like to perform some operation on the items that are currently displayed in the visible portion of the <code>ListView</code>, depending on how the <code>ListView</code> has been scrolled; thus I thought to implements the <code>OnScrollListener</code> of the <code>ListView</code>. Accordingly to the Android api reference, the onScroll method "will be called after the scroll has completed". This seems to me right what I needed, as once the scroll has completed, I perform my actions on the <code>ListView</code> (the onScroll method returns the index of the first item displayed and the number of items displayed). </p> <p>But once implemented, I see from the <code>LogCat</code> that the onScroll method is not just fired once the scroll has completed, but is fired for every new item that enters the displaying view, from the beginning to the end of the scrolling. This is not the behavior I expect nor I need. The other method of the listener (onScrollStateChanged), instead, does not provide information about the items currently displayed in the <code>ListView</code>.</p> <p>So, does anyone know how to use this couple of methods to detect the ending of the scroll and get the information about the displayed items? The misalignment between the api reference and the actual behavior of the method confused me a bit. Thanks in advance.</p> <p>P.S.: I've seen some similar topics around, but nothing helps me understanding how the whole thing works..!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload