android - OnScrollListener in Grid view -


i using grid view in 12 image web service when pass page no 1 , used onscrolllistener automatic run webservice(page 2) when reached ending not working page no 3 mean 24 images not execute third time.

and code ----

gridview.setonscrolllistener(new onscrolllistener() {                 public void onscrollstatechanged(abslistview view, int scrollstate)                 {                 }                  public void onscroll(abslistview view, int firstvisibleitem,                         int visibleitemcount, int totalitemcount) {                      if(firstvisibleitem+visibleitemcount == totalitemcount && totalitemcount!=0)                     {                          if(flag_loading == false)                         {                             flag_loading = true;                             int_current_page += 1;                             toast.maketext(_activity, ""+int_current_page, toast.length_short).show();                                if (int_current_page <= int_total_page)                             {                                                   new photostask().execute();                              }                          }                      }                 }             }); 

and m fresher in android field plz me :)

thanks in advance


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -