// class members
private TextView textView;
private in maxViewed = 0;
// in your onCreate method
// find pointer to where you are displaying to user how many items he's viewed
textView = (TextView)findViewById(R.id.textView); // make sure to make this item in your layout
// make the scroll listener for the listview
listView.setOnScrollListener(new OnScrollListener(){
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
// keep track of how many items we've viewed
maxViewed = Math.max(maxViewed, listView.getLastVisiblePosition());
textView.setText(String.valueOf(maxViewed));
}
});