java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sid.test/com.example.sid.test.DynamicButtonAdd}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

  1. 0

    Programically add button on android

    Stack Overflow | 4 months ago | Siddhartha Sadhukhan
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sid.test/com.example.sid.test.DynamicButtonAdd}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  2. 0

    Trying to include toolbar..but getting this exception

    Stack Overflow | 10 months ago | Rakesh
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  3. 0

    RecyclerView's onClick method crashes the app

    Stack Overflow | 9 months ago | Crazy Ninja
    java.lang.IllegalStateException: Could not execute method of the activity
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IllegalStateException in Fragment Activity

    Stack Overflow | 4 years ago | seekme_94
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  6. 0

    How to Add Dynamic row view in Scrollview in android?

    Stack Overflow | 4 years ago | crickpatel0024
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testdyanamicscroll/com.example.testdyanamicscroll.TestDynamicScroll}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

  1. Indri Yunita 6 times, last 7 days ago
  2. filpgame 1 times, last 2 months ago
  3. kuldeep 5 times, last 3 months ago
  4. harsha 1 times, last 4 months ago
  5. mrokay97 14 times, last 4 months ago
4 more registered users
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. 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()
  2. Android Platform
    ViewGroup.addView
    1. android.view.ViewGroup.addViewInner(ViewGroup.java:1976)
    2. android.view.ViewGroup.addView(ViewGroup.java:1871)
    3. android.view.ViewGroup.addView(ViewGroup.java:1828)
    4. android.view.ViewGroup.addView(ViewGroup.java:1808)
    4 frames
  3. Android v7
    AppCompatActivity.setContentView
    1. android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:271)
    2. android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
    2 frames
  4. com.example.sid
    DynamicButtonAdd.onCreate
    1. com.example.sid.test.DynamicButtonAdd.onCreate(DynamicButtonAdd.java:106)
    1 frame
  5. Android Platform
    ActivityThread.performLaunchActivity
    1. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
    2 frames