java.lang.IllegalStateException

The specified child already has a parent. You must call removeView() on the child's parent first.

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web374

Stack trace

  • 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:3883) at android.view.ViewGroup.addView(ViewGroup.java:3736) at android.view.ViewGroup.addView(ViewGroup.java:3681) at android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:638) at android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107) at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:7054) at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7012) at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7000) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1428) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377) at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1193) at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1043) at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4357) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:549) 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:5349) 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:908) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
filpgamefilpgame
2 times, last one
Indri YunitaIndri Yunita
6 times, last one
kuldeepkuldeep
5 times, last one
18 more bugmates