When we use Android to load more data in the ListView, the view will slide to the first if you re-adapter each time.
Later I found that the ListView has a way to get to the top of which one
int position = Mlistview.getfirstvisibleposition ();
This allows you to get the number of the first line currently displayed.
So I have found a way to load more data after that. If we set his position, we won't have to scroll to the first bar.
Mlistview.setselection (position);
But look closely, there is a little movement, because the method above is to get the first full display of the item, there may be a half item, if you position is not exactly the top of it, he will let it just right, there will be a deviation.
And then I found that there was another way
Mlistview.setselectionfromtop (position, top);
So this top is the first position item is already away from the top.
How did you get it? There is also a method:
View v = mlistview.getchildat (0);
top = (v = = null)? 0:v.gettop ();
Android ListView Load More location issues