java.lang.IllegalArgumentException

Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{face30b position=63 id=-1, oldPos=-1, pLpos:-1 tmpDetached no parent}

Samebug tips2

This happens when you have android:animateLayoutChanges set to true in your XML file and you call notifyDataSetChanged(). To fix it, you have to set android:animateLayoutChanges to false.

In your xml just avoid using android:animateLayoutChanges with RecyclerViews.and also if you have set android:focusableInTouchMode="true" in your RecycleView you have to set false.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web17685

  • via GitHub by Yellow5A5
    , 9 months ago
    Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{face30b position=63 id=-1, oldPos=-1, pLpos:-1 tmpDetached no parent}
  • Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{f0f213a position=5 id=-1, oldPos=-1, pLpos:-1 tmpDetached no parent}
  • Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{2414800 position=0 id=-1, oldPos=-1, pLpos:-1 update tmpDetached no parent}
  • Stack trace

    • java.lang.IllegalArgumentException: Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{face30b position=63 id=-1, oldPos=-1, pLpos:-1 tmpDetached no parent} at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:5235) at android.support.v7.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1198) at android.support.v7.widget.RecyclerView.access$6400(RecyclerView.java:150) at android.support.v7.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:10828) at android.support.v7.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:11328) at android.support.v7.widget.SimpleItemAnimator.dispatchAddFinished(SimpleItemAnimator.java:289) at android.support.v7.widget.DefaultItemAnimator$5.onAnimationEnd(DefaultItemAnimator.java:242) at android.support.v4.view.ViewPropertyAnimatorCompatJB$1.onAnimationEnd(ViewPropertyAnimatorCompatJB.java:47) at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1114) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766) at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:619) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    8 times, 1 month ago
    Once, 2 months ago
    12 times, 11 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    6 more bugmates