UltimateRecyclerView
UltimateRecyclerView copied to clipboard
java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
08-06 18:34:26.649 31234-31234/com.marshalchen.ultimaterecyclerview.demo E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.marshalchen.ultimaterecyclerview.demo, PID: 31234 java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1 at java.util.ArrayList.remove(ArrayList.java:405) at com.marshalchen.ultimaterecyclerview.UltimateViewAdapter.remove(UltimateViewAdapter.java:183) at com.marshalchen.ultimaterecyclerview.demo.SimpleAdapter.remove(SimpleAdapter.java:80) at com.marshalchen.ultimaterecyclerview.demo.SimpleAdapter.onItemDismiss(SimpleAdapter.java:157) at com.marshalchen.ultimaterecyclerview.itemTouchHelper.SimpleItemTouchHelperCallback.onSwiped(SimpleItemTouchHelperCallback.java:76) at android.support.v7.widget.helper.ItemTouchHelper$4.run(ItemTouchHelper.java:669) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5942) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Could you tell me how to reappear this bug?
切换动画模式,然后多刷新几次,就报错了,不是必现的
是在下拉刷新的时候,同时做删除操作,引起的崩溃
08-07 09:43:25.195 26466-26466/com.marshalchen.ultimaterecyclerview.demo E/ViewRootImpl﹕ sendUserActionEvent() mView == null 08-07 09:43:33.155 26466-26466/com.marshalchen.ultimaterecyclerview.demo E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.marshalchen.ultimaterecyclerview.demo, PID: 26466 java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0 at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:6017) at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:5983) at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:5971) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1373) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1322) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:556) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2673) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2971) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:562) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1077) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556) at android.widget.LinearLayout.onLayout(LinearLayout.java:1465) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573) at android.widget.FrameLayout.onLayout(FrameLayout.java:508) at android.view.View.layout(View.java:16678) at android.view.ViewGroup.layout(ViewGroup.java:5328) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2319) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2032) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6643) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777) at android.view.Choreographer.doCallbacks(Choreographer.java:590) at android.view.Choreographer.doFrame(Choreographer.java:560) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5942) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.inte
,cause new bug,when i choose ADMob ListView Test,then Scroll and press the Del button, it cause
this Exception .
You can disable the swipe gesture when the recyclerview refreshing if you want to solve it now.
@cymcsg how to disable swipe gesture when recyclerview refreshing?
I had the same error and the solution for me was to no longer specify my own ids. So I removed the following lines of code and it started working again:
public MyAdapter(Context context) {
this.context = context;
- setHasStableIds(true) // <----- removed this
}
and all of this:
- @Override
- public long getItemId(int position) {
- return position;
- }
我也碰到这个错误了 是怎么解决的啊
I have this found by v0.7.0
java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
@cymcsg i have the same problem too. Do we need to roll-back to the previous version??
dependencies{ compile 'com.hkm.ui:ultimaterecyclerview:0.5.91' }
How can I reappear the exception? By removing a item when the recyclerview is refreshing as @hush881025 said? @jjhesk
Any updates regarding this issue?
I don't have any direct scenario to reproduce it, I got the this crash from Crashlytics