cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

Crash when loadMore #374

Closed lgxDesign closed 8 years ago

lgxDesign commented 8 years ago

java.lang.IllegalArgumentException: Called attach on a child which is not detached: ViewHolder{36ea4f63 position=7 id=-1, oldPos=-1, pLpos:-1 not recyclable(1)} at android.support.v7.widget.RecyclerView$5.attachViewToParent(RecyclerView.java:634) at android.support.v7.widget.ChildHelper.attachViewToParent(ChildHelper.java:239) at android.support.v7.widget.RecyclerView.addAnimatingView(RecyclerView.java:1082) at android.support.v7.widget.RecyclerView.animateDisappearance(RecyclerView.java:3244) at android.support.v7.widget.RecyclerView.access$700(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$4.processDisappeared(RecyclerView.java:422) at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:240) at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3086) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2914) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3277) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:596) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557) at android.widget.LinearLayout.onLayout(LinearLayout.java:1466) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557) at android.widget.LinearLayout.onLayout(LinearLayout.java:1466) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:15604) at android.view.ViewGroup.layout(ViewGroup.java:4967) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2072) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1829) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5786) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at

jjhesk commented 8 years ago

this may contribute to the Google bug. if that is dealing with the footer loading issue that this really need to be fixed again.

lgxDesign commented 8 years ago

When I do this, crash will hapen ultimateRecyclerView.disableLoadmore(); ultimateRecyclerView.reenableLoadmore();

Is really a bug for contributing to the Google?

jjhesk commented 8 years ago

im trying to avoid this when the loadmore view is automatically determined by the scroll. But another condition gives that this view is disabled and reenabled. however if u wait until the animation is finished from disappearing [out side the visible area] the crash is gone. what is correct implementation for this?

jjhesk commented 8 years ago

@lgxDesign ok now try out with the fix now. #377 #376 check out the latest version.

lgxDesign commented 8 years ago

Okay, I'll try later

jjhesk commented 8 years ago

i go ahead and close it. u can reopen this if this issue is still outstanding. @lgxDesign