Scroll bar not reaching to the end
<blockquote>
  <p>I am using onScrollListener,to load more data when scroll reaches the
  end of the screen.But when I scroll it is not reaching completely to
  the end of the screen,it is leaving an gap of around (half of the last
  row)and it is calling another webservice to load the data.</p>
  
  <p>I am using the following code to test whether the scroll reaches
  the end of the screen or not</p>
</blockquote>

<pre><code>     public void onScroll(AbsListView view, int firstVisibleItem,int visibleItemCount, int totalItemCount) 
          {             
//           public void onScrollStateChanged(AbsListView view , int scrollState)
//           {
//                  if (scrollState != 0) {  
//                      listView.getAdapter().isScrolling = true; 
//                  }
//                  else {   
//                      listView.getAdapter().isScrolling = false;  
//                      listView.getAdapter().notifyDataSetChanged();  
//                  }  
//              }  
              // TODO Auto-generated method stub

              if (loading) {
                  if (totalItemCount &gt; previousTotal) {
                      loading = false;
                      previousTotal = totalItemCount;
                  }
              } 
//                   int lastInScreen = firstVisibleItem + visibleItemCount; 
              if (!loading &amp;&amp; (totalItemCount - visibleItemCount) ==(firstVisibleItem + threshold)){
//                    if(((firstVisibleItem + visibleItemCount) == totalItemCount)){
//                   if (!(loading)  &amp;&amp;(totalItemCount - visibleItemCount) ==(firstVisibleItem + threshold)) {
                  clearAllResources(); 

//                  if (!(loading)  &amp;&amp;(totalItemCount - visibleItemCount) == (firstVisibleItem + threshold)) {
                       Log.v("in gridview loading more","grid load");
//                      
                       doback(webserv);
                    loading = true;
                   }
              }



      });
</code></pre>

<p>I also kept the footer to the listview ,I just want to show that footer before loading more data.But it is not reaching to the end to show that.
please help me 
 Thankyou</p>
