Recyclerview onscrolllistener not working when setNestedScrollingEnabled to false
<p>I want to implement pagination with <code>recyclerView</code>, for this I add <code>addOnScrollListener</code> to the <code>recyclerView</code> but I am having trouble with <code>RecyclerView.OnScrollListener</code> not working when I set <code>rvGridExplore.setNestedScrollingEnabled(false);</code> </p>

<p>But when I remove <code>rvGridExplore.setNestedScrollingEnabled(false);</code> it is working fine,
I don't know how to handle this.</p>

<p>Here is code:</p>

<pre><code>rvGridExplore = (RecyclerView) view.findViewById(R.id.rvGridExplore);
        final GridLayoutManager glm = new GridLayoutManager(context,2);
       // rvGridExplore.setNestedScrollingEnabled(false);
        rvGridExplore.setLayoutManager(glm);

       // final int visibleItemCount,totalCount,pastVisibleItems;
        rvGridExplore.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                super.onScrollStateChanged(recyclerView, newState);
                Log.v("scrollll","state changed");
            }

            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                super.onScrolled(recyclerView, dx, dy);
                if (dy &gt; 0) {
                    int totalCount = glm.getItemCount();
                    int visibleItemCount = glm.getChildCount();
                    int pastVisibleItems = glm.findFirstVisibleItemPosition();
                    if (loading) {
                        if ((visibleItemCount + pastVisibleItems) &gt;= totalCount) {
                            Log.v("scroll","scrolled"+pastVisibleItems);
                        }
                    }

                }
            }
        });
</code></pre>