android - on button click retrieve first 5 arraylist record and so on -


in application having listview.i want display first 5 records arraylist , when user click button load more 5 . aaraylist size 25. can first 5 records how retrieve next five.any help?

final arraylist<hashmap<string,string>> newbrnd=new arraylist<hashmap<string,string>>(authorizedservicecenter);                 final arraylist<hashmap<string,string>> newbrnd_=new arraylist<hashmap<string,string>>();                    if(authorizedservicecenter.size()>5)                 {                     for(int i=0;i<5;i++)                     {                          newbrnd_.add(newbrnd.get(i));                         newbrnd.remove(i);                          log.e("details..", ""+newbrnd_.tostring());                         log.e("remove", ""+newbrnd.get(i));                      }                  }                  loadmore1.setonclicklistener(new onclicklistener()                 {                      @override                     public void onclick(view v)                      {                          for(int i=5;i<10;i++)                         {                             newbrnd_.add(newbrnd.get(i));                             newbrnd.remove(i);                              log.e(" details..", ""+newbrnd_.get(i));                             log.e(" remove.", ""+newbrnd.get(i));                          }                      }                 }); 


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -