title: Android ListView setOnScrollListener
body: <p>I'm having problem with my setOnScrollListener. It just keeps calling my asynctask whenever I scroll to the bottom of the listview. How do I set the setOnScrollListener to load only once I reach the bottom. </p>
  
  <pre><code>listview.setAdapter(adapter);
  mProgressDialog.dismiss();
  
  listview.setOnScrollListener(new OnScrollListener() {
  
      @Override
      public void onScrollStateChanged(AbsListView view, int scrollState) { 
          // TODO Auto-generated method stub
      }
  
      @Override
      public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
          int lastInScreen = firstVisibleItem + visibleItemCount;
          if (lastInScreen == totalItemCount) {
              new loadmore().execute();
          } else {
          }
      }
  );
  </code></pre>