Im getting a crash in this method initChildDimensions and I don't understand really why. Anyone experienced this issue?
The Crash Report:
Fatal Exception: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:5252)
at android.view.ViewGroup.addView(ViewGroup.java:5083)
at android.view.ViewGroup.addView(ViewGroup.java:5023)
at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:851)
at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:107)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:8336)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8294)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8282)
at com.yarolegovich.discretescrollview.RecyclerViewProxy.getMeasuredChildForAdapterPosition(RecyclerViewProxy.java:54)
at com.yarolegovich.discretescrollview.DiscreteScrollLayoutManager.initChildDimensions(DiscreteScrollLayoutManager.java:148)
at com.yarolegovich.discretescrollview.DiscreteScrollLayoutManager.onLayoutChildren(DiscreteScrollLayoutManager.java:116)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at android.view.View.layout(View.java:22398)
at android.view.ViewGroup.layout(ViewGroup.java:6577)
at androidx.constraintlayout.motion.widget.MotionPaths.setView(MotionPaths.java:393)
at androidx.constraintlayout.motion.widget.MotionController.interpolate(MotionController.java:920)
at androidx.constraintlayout.motion.widget.MotionLayout.evaluate(MotionLayout.java:2427)
at androidx.constraintlayout.motion.widget.MotionLayout.dispatchDraw(MotionLayout.java:2252)
at android.view.View.draw(View.java:21863)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1873)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at com.sothree.slidinguppanel.SlidingUpPanelLayout.drawChild(SlidingUpPanelLayout.java:1201)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at com.sothree.slidinguppanel.SlidingUpPanelLayout.draw(SlidingUpPanelLayout.java:1244)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1873)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at com.android.internal.policy.DecorView.draw(DecorView.java:1083)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3932)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3706)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3014)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1873)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8478)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6986)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
Hi,
Im getting a crash in this method initChildDimensions and I don't understand really why. Anyone experienced this issue?
The Crash Report: Fatal Exception: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:5252) at android.view.ViewGroup.addView(ViewGroup.java:5083) at android.view.ViewGroup.addView(ViewGroup.java:5023) at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:851) at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:107) at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:8336) at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8294) at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:8282) at com.yarolegovich.discretescrollview.RecyclerViewProxy.getMeasuredChildForAdapterPosition(RecyclerViewProxy.java:54) at com.yarolegovich.discretescrollview.DiscreteScrollLayoutManager.initChildDimensions(DiscreteScrollLayoutManager.java:148) at com.yarolegovich.discretescrollview.DiscreteScrollLayoutManager.onLayoutChildren(DiscreteScrollLayoutManager.java:116) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924) at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641) at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194) at android.view.View.layout(View.java:22398) at android.view.ViewGroup.layout(ViewGroup.java:6577) at androidx.constraintlayout.motion.widget.MotionPaths.setView(MotionPaths.java:393) at androidx.constraintlayout.motion.widget.MotionController.interpolate(MotionController.java:920) at androidx.constraintlayout.motion.widget.MotionLayout.evaluate(MotionLayout.java:2427) at androidx.constraintlayout.motion.widget.MotionLayout.dispatchDraw(MotionLayout.java:2252) at android.view.View.draw(View.java:21863) at android.view.View.updateDisplayListIfDirty(View.java:20733) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1873) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at com.sothree.slidinguppanel.SlidingUpPanelLayout.drawChild(SlidingUpPanelLayout.java:1201) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.draw(View.java:21863) at com.sothree.slidinguppanel.SlidingUpPanelLayout.draw(SlidingUpPanelLayout.java:1244) at android.view.View.updateDisplayListIfDirty(View.java:20733) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1873) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1426) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.draw(View.java:21863) at android.view.View.updateDisplayListIfDirty(View.java:20733) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.updateDisplayListIfDirty(View.java:20719) at android.view.View.draw(View.java:21586) at android.view.ViewGroup.drawChild(ViewGroup.java:4551) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326) at android.view.View.draw(View.java:21863) at com.android.internal.policy.DecorView.draw(DecorView.java:1083) at android.view.View.updateDisplayListIfDirty(View.java:20733) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3932) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3706) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3014) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1873) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8478) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949) at android.view.Choreographer.doCallbacks(Choreographer.java:761) at android.view.Choreographer.doFrame(Choreographer.java:696) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:6986) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)