1. Scroll Loading
Listview. setonscrolllistener (New onscrolllistener () {// Add the scroll bar to the bottom and load the remaining elements @ override public void onscrollstatechanged (abslistview view, int scrollstate) {If (scrollstate = onscrolllistener. scroll_state_idle) {loadremnantlistitem () ;}@ override public void onscroll (abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) {}}); listview. setonitemselectedlistener (New onit Emselectedlistener () {// press the key to select the item in the list. The focus is on the bottom view to load the remaining item @ override public void onitemselected (adapterview <?> Parent, view, int position, long ID) {If (footerview = view) {loadremnantlistitem (); listview. setselection (position-1) ;}}@ override public void onnothingselected (adapterview <?> Parent) {}}); Private void loadremnantlistitem () {// rolls to load the remaining data // dynamically changes the listadapter. getcount () Return Value // use handler to call listadapter. notifydatasetchanged (); update data}
2. Rolling pages
// Listview listenerCodeSame private void loadremnantlistitem () {// roll to load the remaining data // re-listview. setadapter (newsadapter); // use handler to call listadapter. notifydatasetchanged (); update data}