android / views-widgets-samples

Multiple samples showing the best practices in views-widgets on Android.
Apache License 2.0
5.04k stars 3.01k forks source link

Tmp detached view should be removed from RecyclerView #13

Open jishindev opened 5 years ago

jishindev commented 5 years ago

Don't know if this is an appropriate place to report this but submitting anyway.

App crash when using RecyclerView along with ListAdapter

java.lang.IllegalArgumentException: Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{ebf584c position=-1 id=-1, oldPos=-1, pLpos:-1 removed tmpDetached no parent} androidx.recyclerview.widget.RecyclerView{eaf69a2 VFED..... ........ 0,864-1200,1343 #7f0801b0 app:id/rvCountries}, adapter:co.dagang.android.agent.custom.adapters.PagingRvListAdapter@79ca4d0, layout:androidx.recyclerview.widget.LinearLayoutManager@c9bcc9, context:co.dagang.android.agent.ui.presets.CountrySelectorActivity@a6e8454
        at androidx.recyclerview.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:6415)
        at androidx.recyclerview.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1470)
        at androidx.recyclerview.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:12671)
        at androidx.recyclerview.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:13171)
        at androidx.recyclerview.widget.SimpleItemAnimator.dispatchMoveFinished(SimpleItemAnimator.java:292)
        at androidx.recyclerview.widget.DefaultItemAnimator$6.onAnimationEnd(DefaultItemAnimator.java:311)
        at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1122)
        at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:552)
        at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1209)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1449)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.-wrap2(Unknown Source:0)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
        at android.view.Choreographer.doCallbacks(Choreographer.java:778)
        at android.view.Choreographer.doFrame(Choreographer.java:710)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6518)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)