Hello guys. I have yet another problem.
I have a simple app that has "endless" scroll(simple example would be 9gag, except 9gag is a web page), the point is when user scrolls to bottom new items/articles are loaded.
I have managed to do the endless scrolling, the problem is when I do a fling gesture the list would scroll to the bottom and load more items(as expected), and since the loading takes just about a second, after loading new items list keeps on scrolling, then again scroll reaches bottom - loading more stuff, scroll to bottom ~ load more and so on untill it stops depending on the speed of the fling gesture. What I would like to do is to stop the scrolling programmaticaly after each loading.
I have searched for a few hours now but I can't find the solution. Looking through API didn't help. I new to java/android.
Perhaps you have done something similar in the past or know a method in API that would help. Please help me.
Here is a simple structure of my code.
ListView lv;
lv.scrollListener(){
if(scrollIsAtTheBottom){
LoadMoreStuff();
}
}
function loadMoreStuff(){
loadingStuffFromURL();
applying changes to list;
stop scrolling;
}
I hope you can understand the problem.