I have a customized gridview where i'm checking onScroll method to find the end of the list. If the scroll reaches the end of the list, it will again add few elements in to the list.
gridview.setOnScrollListener(new OnScrollListener() {
        @Override
        public void onScrollStateChanged(AbsListView arg0, int arg1) {
        }
        @Override
        public void onScroll(AbsListView arg0, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            // TODO Auto-generated method stub
            int lastInScreen = firstVisibleItem + visibleItemCount;     
            //is the bottom item visible & not loading more already ? Load more !
            if((lastInScreen == totalItemCount) && (!loadingMore))
            {   
                new LoadDataTask().execute();
            } 
        }
    });
And this is my Asynchronous task class..
    private class LoadDataTask extends AsyncTask<Void, Void, Void> {
    @Override
    protected Void doInBackground(Void... params) {
        if (isCancelled()) {
            return null;
        }
        loadingMore = true;
        for (int i = 0; i < mNames.length; i++)
            mListItems.add(mNames[i]);
        return null;
    }
    @Override
    protected void onPostExecute(Void result) {
        mListItems.add("Added after load more");
         loadingMore=false;
        adapter.notifyDataSetChanged();
        super.onPostExecute(result);
    }
    @Override
    protected void onCancelled() {
    }
}
Now the issue is that the onScroll method keep on calling. It doesn't stop even when the user not scrolling. Can anyone have a solution ?
 
     
    