解决recyclerView.setOnScrollChangeListener只能只能在api23以上使用问题

//使用这个方法替代
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override public void onScrollStateChanged( RecyclerView recyclerView , int newState) { super.onScrollStateChanged(recyclerView , newState) ; //onScrollStateChanged will be fire every time you scroll //Perform your operation here int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition() ; if (lastVisibleItemPosition + 1 == adapter.getItemCount()) { //此处做分页时可以用到,监听 recyclerView滑动到底部 } }}) ;

你可能感兴趣的:(安卓问题解决)