java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:3

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

This is a bug in UltimateRecyclerView. One workaround is disabling the swipe gesture when the recyclerview is refreshing. Another workaround seems to be not specifying your own ids

,

You should use View v = inflater.inflate(R.layout.your_layout, parent, false);

instead of View v = inflater.inflate(R.layout.your_layout, parent, true);

Solutions on the web

via GitHub by woniu0936
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:3
via GitHub by caoeryang
, 11 months ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by muhezi
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:5
via GitHub by yuruxuan
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by captain-miao
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by wyy283
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:1
java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:3
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:6720)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6686)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6674)
at android.support.v7.widget.StaggeredGridLayoutManager.fill(StaggeredGridLayoutManager.java:1559)
at android.support.v7.widget.StaggeredGridLayoutManager.scrollBy(StaggeredGridLayoutManager.java:2060)
at android.support.v7.widget.StaggeredGridLayoutManager.scrollVerticallyBy(StaggeredGridLayoutManager.java:1980)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:571)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:5784)
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:1084)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.