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

Solutions on the web

via GitHub by GoogleCodeExporter
, 1 year ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via GitHub by Don-Doudou
, 2 years ago
You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative.
via code2care.org by Unknown author, 1 year ago
via Stack Overflow by user3040968
, 1 year ago
ScrollView can host only one direct child
via Stack Overflow by Drille Doge
, 1 year ago
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
via Stack Overflow by ZachGiovanelli
, 3 months ago
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
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:2117)
at android.view.ViewGroup.addView(ViewGroup.java:2012)
at android.view.ViewGroup.addView(ViewGroup.java:1992)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:279)
at android.app.Activity.setContentView(Activity.java:1727)
at de.cwde.freeshisen.ShisenShoActivity.onCreate(ShisenShoActivity.java:34)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1660)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1716)
at android.app.ActivityThread.access$1500(ActivityThread.java:124)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3806)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)

Users with the same issue

2 times, 1 year ago
6 times, 1 year ago
5 times, 1 year ago
Once, 1 year ago
14 times, 1 year ago

Write tip

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