When we do a ListView batch load, we need to call Setonscrolllistener for the ListView (Specific code visible in my previous blog)
However, we will find that the ListView does not scroll when running the program, so why does the system call the Onscroll method? (Supplemental: onscrollstatechanged is not called at this time)
Let's look at Setonscrolllistener source code first:
public void Setonscrolllistener (Onscrolllistener l) { monscrolllistener = l; Invokeonitemscrolllistener (); }
Setonscrolllistener inside called the Invokeonitemscrolllistener () method, and then see the method source code:
void Invokeonitemscrolllistener () { if (mfastscroller! = null) { Mfastscroller.onscroll (mfirstposition, Getchildcount (), mitemcount); } if (Monscrolllistener! = null) { Monscrolllistener.onscroll (this, mfirstposition, Getchildcount (), mitemcount);// Call onscroll here, everything is out of the truth. } Onscrollchanged (0, 0, 0, 0); Dummy values, View ' s implementation does not use these. }