question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
 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.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

12reactions
jiangechocommented, Mar 21, 2016

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

1reaction
progfilescommented, Feb 13, 2016

set mBookingsList.enableLoadmore() after add first items range

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempt to write to field 'int android.support.v7.widget ...
Your probably returning a null on onCreateViewHolder on your adapter class ... ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) ...
Read more >
java.lang.NullPointerException: Attempt to write to field 'int ...
NullPointerException: Attempt to write to field 'int android.support.v7.widget.RecyclerView$ViewHolder.mItemViewType' on a null object #372.
Read more >
Attempt to write to field 'int android.support.v7.widget ... - 简书
Attempt to write to field 'int android.support.v7.widget.RecyclerView$ViewHolder.mItemViewType' on a null object reference.
Read more >
Attempt to write to field 'int android.support.v7.widget ... - 腾讯云
Attempt to write to field 'int android.support.v7.widget.RecyclerView$ViewHolder. ... mItemViewType' on a null object reference at ...
Read more >
RecyclerView.ViewHolder - Android Developers
Returns the position of the ViewHolder in terms of the latest layout pass. final int. getOldPosition(). When LayoutManager supports animations, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found