UltimateRecyclerView icon indicating copy to clipboard operation
UltimateRecyclerView copied to clipboard

Attempt to write to field 'int android.support.v7.widget.RecyclerView$ViewHolder.mItemViewType' on a null object reference

Open dekaustubh opened this issue 9 years ago • 7 comments

 mBookingsList.enableLoadmore();
    mBookingsList.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
        @Override
        public void loadMore(int itemsCount, int maxLastVisiblePosition) {

        }
    });

I am getting null pointer exception when I scroll the recycler view.

dekaustubh avatar Oct 19 '15 10:10 dekaustubh

I am extending it with UltimateViewAdapter<MyViewHolder>

dekaustubh avatar Oct 19 '15 10:10 dekaustubh

i have made some similar design pattern to work with this mechanism and issued in another library this is the sample code.

jjhesk avatar Oct 20 '15 02:10 jjhesk

set mBookingsList.enableLoadmore() after add first items range

progfiles avatar Feb 13 '16 10:02 progfiles

@progfiles i dont understand, how can i do that?

huy-lv avatar Feb 29 '16 07:02 huy-lv

same issue.

jiangecho avatar Mar 21 '16 09:03 jiangecho

@Kaustubh-Deshmukh please check your getViewHolder(), if this method return null, would cause this issue.

jiangecho avatar Mar 21 '16 09:03 jiangecho

I added layout manager this way to fix it:

final ScrollSmoothLineaerLayoutManager mgm = new ScrollSmoothLineaerLayoutManager(this, LinearLayoutManager.VERTICAL, false, 300);
myURecycleRView.setLayoutManager(mgm);

iballan avatar Feb 01 '17 20:02 iballan