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

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

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by Urie P.
, 1 year ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Euphor08
, 1 year ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Niko
, 2 years ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Whiz
, 2 years ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by JavaForAndroid
, 2 years ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Styler2go
, 2 years ago
The specified child already has a parent. You must call removeView() on the child's parent first.
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:3430)
at android.view.ViewGroup.addView(ViewGroup.java:3301)
at android.view.ViewGroup.addView(ViewGroup.java:3277)
at com.android.internal.app.AlertController.setupView(AlertController.java:416)
at android.app.AlertDialog.onCreate(AlertDialog.java:337)
at android.app.Dialog.dispatchOnCreate(Dialog.java:355)
at android.app.Dialog.show(Dialog.java:260)
at android.app.AlertDialog$Builder.show(AlertDialog.java:951)
at mono.android.widget.AdapterView_OnItemClickListenerImplementor.n_onItemClick(Native Method)
at mono.android.widget.AdapterView_OnItemClickListenerImplementor.onItemClick(AdapterView_OnItemClickListenerImplementor.java:29)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1128)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2815)
at android.widget.AbsListView$1.run(AbsListView.java:3574)
at android.os.Handler.handleCallback(Handler.java:800)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5371)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)

Users with the same issue

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

Write tip

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