title: Disable loading in Pull to refresh listview
body: <p>I am having Pull to Refresh <a href="https://github.com/chrisbanes/Android-PullToRefresh" rel="nofollow">https://github.com/chrisbanes/Android-PullToRefresh</a> as given in this link. Everything works fine. But when my list item finishes, the loading icon and pull to refresh label is still visible. So, how to disable the scrolling when end of list reached?</p>
  
  <pre><code>mainListView.setOnRefreshListener(new OnRefreshListener() {
  
                  @Override
                  public void onRefresh(PullToRefreshBase refreshView) {
  
                                          String total_bk_count = subCategory                                                 .getTotal_Book_Count();
                                          count_of_book = Integer.parseInt(total_bk_count);
                                          listCountt = mainbooksAdpater.getCount();
                                          Log.e("StroreActivity","Total book count---====----====---+"+count_of_book);
                                          Log.e("StroreActivity","list Count---====----====---+"+listCountt);
                                          if(listCountt &lt; count_of_book)
                                          {
  
                                              int bookCount = Common.getBookCountNumber();
                                              Common.setBookCount(bookCount+1);
                                              String refresh_Pull_Url = Common.getUrlForeCategoryBooks(id, Common.NUMBER_OF_BOOKS_PER_REQUEST);
                                              Log.e("Rathis to Check url", Common.getUrlForeCategoryBooks(id, Common.NUMBER_OF_BOOKS_PER_REQUEST));
                                              PulltoRefreshAsync onCatBooksTaskScroll = new PulltoRefreshAsync(Common.getUrlForeCategoryBooks(id, Common.NUMBER_OF_BOOKS_PER_REQUEST));
                                              onCatBooksTaskScroll.execute();
  
                                          Log.e("StroreActivity","Total Book count::" + book_count_no);
  
                                      }
                                          else
                                          {
  
                                          mainListView.setMode(Mode.DISABLED);    
                                          Toast.makeText(getApplicationContext(), "end of list", Toast.LENGTH_SHORT).show();
  
                                          }
                                      }
                                  });
  </code></pre>
  
  <p>Asynctask Class:</p>
  
  <pre><code>public class PulltoRefreshAsync extends AsyncTask&lt;Object,Object,Object&gt; {
      int refreshCount;
      String refresh_URL;
      public PulltoRefreshAsync(String url) {
          refresh_URL = url;
  
      }
  
      /*
       * PulltoRefreshAsync(int i) { refreshCount = i; }
       */
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          Log.e("Checking Purpose", refresh_URL);
  
  
  
  
      }
  
      @Override
      protected String doInBackground(Object... arg0) {
          JsonParserRefresh jp = new JsonParserRefresh();
          Log.e("StroreActivity","Array to String::" + refresh_URL);
          String jsonString = jp.getJSONFromURL(refresh_URL);
          Log.e("StroreActivity","JsonString::" + jsonString);
          jsonParseForCategoryBooksGridScroll(jsonString);
          return null;
      }
  
      @Override
      protected void onPostExecute(Object result) {
          super.onPostExecute(result);
          /*
           * if(mProgressDialog.isShowing()) { mProgressDialog.dismiss(); }
           */
  
          final MainBooksAdapter mainbooksAdpater = new MainBooksAdapter(
                  StoreActivity.this, R.layout.aa, mainBooksList);
          final int old_pos = mainListView.getRefreshableView()
                  .getFirstVisiblePosition() + 1;
          mainListView.setAdapter(mainbooksAdpater);
  
          tvvisiblebookCount.setText("" + mainbooksAdpater.getCount());
  
          /*if(listCountt &lt; count_of_book)
          {
  
              mainListView.setMode(Mode.DISABLED);*/
          mainListView.post(new Runnable() {
  
              @Override
              public void run() {
                  mainListView.onRefreshComplete();
                  mainListView.getRefreshableView().setSelection(old_pos);
              }
          });
          //}
          mainbooksAdpater.notifyDataSetChanged();
  
      }
  
  
  
  }
  </code></pre>