title: setOnScrollListener infinite loop and loaded without scrolling in GridView?
body: <p>I have a problem with implementing setOnScrollListener in gridview when new data is continously loaded in a loop without user scrolling. I want to wait for user to scroll to the end and only then to load new data. How to accomplish that? This is the code that gives me infinite loop without scrolling:</p>
  
  <pre><code>  gv.setOnScrollListener(new EndlessScrollListener() {
          @Override
          public boolean onLoadMore(int page, int totalItemsCount) {
  
              load_more_data();
  
              // Triggered only when new data needs to be appended to the list
              // Add whatever code is needed to append new items to your AdapterView
              //      customLoadMoreDataFromApi(page);
              // or customLoadMoreDataFromApi(totalItemsCount);
              return true; // ONLY if more data is actually being loaded; false otherwise.
          }
      });
  </code></pre>