I have a gridview and I need to do two things:
When I scroll down, I want to find the last visible position, for example, int index = GridView.getLastVisiblePosition();
When I scroll up, I want to find the first visible position, for example, int index = GridView.getFirstVisiblePosition();
I know that I can use the following code, but I'm not sure how and where to write code for ScrollUp and ScrollDown. Please help me. I am new to Android.
private OnScrollListener onAnswersScrolled = new OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } }
source share