java.lang.NullPointerException: Attempt to read from field 'int android.support.v7.widget.RecyclerView$ItemAnimator$ItemHolderInfo.left' on a null object reference

Stack Overflow | Navas pk | 4 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd , rafael and Rafael Fischer Viola . Or join the community to write better ones.
  1. 0
    samebug tip
    Call notifyDataSetChanged instead of notifyItemRemoved due to a bug in RecyclerView
  2. 0
    samebug tip
    This issue was solved in 2.2.6. If updating doesn't solve, try using notifyItemRangeChanged(1, mDatas.size()) instead of notifyItemRangeChanged(0, mDatas.size()).
  3. 0
    samebug tip
    This probably occurs because you are calling notifyItemInserted(position);, notifyItemChanged(position), or notifyItemRemoved(position); from a background thread (or from a callback, which runs on a background thread). Use a Handler to solve it.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    Try to reset the previous listener before making any changes to the view.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    Attempt to read from field 'int android.support.v7.widget.RecyclerView$ItemAnimator$ItemHolderInfo.left' on a null object reference

    at android.support.v7.widget.SimpleItemAnimator.animateDisappearance()
  2. Android v7
    RecyclerView.onLayout
    1. android.support.v7.widget.SimpleItemAnimator.animateDisappearance(SimpleItemAnimator.java:78)
    2. android.support.v7.widget.RecyclerView.animateDisappearance(RecyclerView.java:3246)
    3. android.support.v7.widget.RecyclerView.access$700(RecyclerView.java:147)
    4. android.support.v7.widget.RecyclerView$4.processDisappeared(RecyclerView.java:422)
    5. android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:231)
    6. android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3086)
    7. android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2914)
    8. android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3277)
    8 frames
  3. Android Platform
    ViewGroup.layout
    1. android.view.View.layout(View.java:16655)
    2. android.view.ViewGroup.layout(ViewGroup.java:5477)
    3. android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
    4. android.view.View.layout(View.java:16655)
    5. android.view.ViewGroup.layout(ViewGroup.java:5477)
    6. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
    7. android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1732)
    8. android.widget.LinearLayout.onLayout(LinearLayout.java:1497)
    9. android.view.View.layout(View.java:16655)
    10. android.view.ViewGroup.layout(ViewGroup.java:5477)
    11. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
    12. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
    13. android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
    14. android.view.View.layout(View.java:16655)
    15. android.view.ViewGroup.layout(ViewGroup.java:5477)
    16. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
    17. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
    18. android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
    19. android.view.View.layout(View.java:16655)
    20. android.view.ViewGroup.layout(ViewGroup.java:5477)
    20 frames
  4. com.android.launcher3
    SlidingUpPanelLayout.onLayout
    1. com.android.launcher3.SlidingUpPanelLayout.onLayout(SlidingUpPanelLayout.java:588)
    1 frame
  5. Android Platform
    FrameLayout.onLayout
    1. android.view.View.layout(View.java:16655)
    2. android.view.ViewGroup.layout(ViewGroup.java:5477)
    3. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
    4. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
    4 frames
  6. com.android.launcher3
    DragLayer.onLayout
    1. com.android.launcher3.DragLayer.onLayout(DragLayer.java:525)
    1 frame
  7. Android Platform
    FrameLayout.onLayout
    1. android.view.View.layout(View.java:16655)
    2. android.view.ViewGroup.layout(ViewGroup.java:5477)
    3. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
    4. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
    5. android.view.View.layout(View.java:16655)
    6. android.view.ViewGroup.layout(ViewGroup.java:5477)
    7. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
    8. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
    9. android.view.View.layout(View.java:16655)
    10. android.view.ViewGroup.layout(ViewGroup.java:5477)
    11. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
    12. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
    13. android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
    14. android.view.View.layout(View.java:16655)
    15. android.view.ViewGroup.layout(ViewGroup.java:5477)
    16. android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
    17. android.widget.FrameLayout.onLayout(FrameLayout.java:273)
    17 frames
  8. Android
    PhoneWindow$DecorView.onLayout
    1. com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2694)
    1 frame
  9. Android Platform
    ActivityThread.main
    1. android.view.View.layout(View.java:16655)
    2. android.view.ViewGroup.layout(ViewGroup.java:5477)
    3. android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
    4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
    5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
    6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
    7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
    8. android.view.Choreographer.doCallbacks(Choreographer.java:670)
    9. android.view.Choreographer.doFrame(Choreographer.java:606)
    10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
    11. android.os.Handler.handleCallback(Handler.java:739)
    12. android.os.Handler.dispatchMessage(Handler.java:95)
    13. android.os.Looper.loop(Looper.java:148)
    14. android.app.ActivityThread.main(ActivityThread.java:5438)
    14 frames
  10. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  11. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:762)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
    2 frames