The app in Android is to swipe down in the ListView to load more features, and don't judge in the Onscroll method, so that when you swipe to the bottom, maybe we need to trigger something, like load more, hide a control, and so on.
The first method is to swipe directly to the bottom to trigger
Listview.setonscrolllistener (New onscrolllistener () { @Override public void onscrollstatechanged (abslistview view, int Scrollstate) { // When not scrolling if (Scrollstate == onscrolllistener.scroll_state_idle) { // decide whether to scroll to the bottom if ( View.getlastvisibleposition () == view.getcount () - 1) { //loading more versatile code } } } });
The second way is to swipe up 2 times to hide
/*** Scroll to the bottom of the list to read the next page of data */public class autoloadlistener implements onscrolllistener{ public interface AutoLoadCallBack { void execute (String url); } private int getlastvisibleposition = 0,lastvisiblepositiony=0; private Autoloadcallback mcallback; public autoloadlistener (AutoLoadCallBack callback) { this.mcallback = callback; } public void onscrollstatechanged ( Abslistview view, int scrollstate) { if (Scrollstate == onscrolllistener.scroll_state_idle) { //Scroll to the bottom if ( View.getlastvisibleposition () == (View.getcount () - 1) { view v= (View) View.getchildat (View.getchildcount ()-1); int[] location = new int[2] ; v.getlocationonscreen (location) ;//Get absolute coordinates over the entire screen int y=location [1];     LOG.E ("x" +location[0], "Y" +location[1]); if (vIew.getlastvisibleposition ()!=getlastvisibleposition && LASTVISIBLEPOSITIONY!=Y)//First drag to the bottom { toast.maketext (View.getcontext (), "Drag again to the bottom to page", ". Show (); getlastvisibleposition=view.getlastvisibleposition (); lastVisiblePositionY=y; return; } else if (view.getlastvisibleposition () = = getlastvisibleposition && lastvisiblepositiony==y)//Drag to the bottom for the second time { Mcallback.execute (">>>>> Drag to Bottom"); } } //does not scroll to the bottom, and the second time is initialized getlastvisibleposition=0; lastvisiblepositiony=0; } } public void onscroll (Abslistview arg0, int arg1, int  ARG2, INT ARG3) { }}
Monitor the ListView in Android swipe to the bottom