Tuesday, May 29, 2012

Buttery Smooth List Scrolling in Android ?

Just implement the following line of code for listview


listView.setOnScrollListener(new OnScrollListener() {
       
       public void onScroll(AbsListView view, int firstVisibleItem,
       int visibleItemCount, int totalItemCoun) {
           public void onScrollStateChanged(AbsListView view, int scrollState) {
               if (scrollState != 0)
                   listView.getAdapter()).isScrolling = true;
               else {
                   listView.getAdapter()).isScrolling = false;
                 listView.getAdapter()).notifyDataSetChanged();
             }
         }
     });

No comments:

Post a Comment