Im looking for an event that I can use on the scrollView to be fired when the user has scrolled to the bottom.
E.g my list of items should be extended with more item
I had the same problem and I solved it by using the ListView (automatically adds ScrollView if needed) and setting OnScrollListener.
Here is a code sample:
tableListView.setOnScrollListener(new OnScrollListener() {
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
if (visibleItemCount == totalItemCount)
// too little items (ScrollView not needed)
{
java.lang.System.out.println("too little items to use a ScrollView!");
}
else {
if ((firstVisibleItem + visibleItemCount) == totalItemCount) {
// put your stuff here
java.lang.System.out.println("end of the line reached!");
}
}
}
});