cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

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

Open dekaustubh opened 9 years ago

dekaustubh commented 9 years ago
 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 commented 9 years ago

I am extending it with UltimateViewAdapter

jjhesk commented 9 years ago

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

progfiles commented 8 years ago

set mBookingsList.enableLoadmore() after add first items range

huy-lv commented 8 years ago

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

jiangecho commented 8 years ago

same issue.

jiangecho commented 8 years ago

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

iballan commented 7 years ago

I added layout manager this way to fix it:

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