title: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first android
body: <p>I am trying to add text in <code>TabView</code> from <code>TextView</code> but getting <code>java.lang.IllegalStateException</code></p>
  
  <p><strong>Activity code :</strong></p>
  
  <pre><code>public class Testimonial extends TabActivity {
  private TabHost tabHost;
  TextView video = null;
  TextView text = null;
  private void setupTabHost() {
      tabHost = (TabHost) findViewById(android.R.id.tabhost);
      tabHost.setup();
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.testimonial);
      setupTabHost();
  
      View view = LayoutInflater.from(getBaseContext()).inflate(R.layout.testimonial_tab_row, null);
      video = (TextView)view.findViewById(R.id.tabVideo);
      text = (TextView)view.findViewById(R.id.tabText);
  
      tabHost = getTabHost();
      TabSpec videoSpec = tabHost.newTabSpec("Video");
      videoSpec.setIndicator(video);
      Intent videoIntent = new Intent(this,TestimonialVideo.class);
      videoSpec.setContent(videoIntent);
      TabSpec textSpec = tabHost.newTabSpec("Text");
      textSpec.setIndicator(text);
      Intent textIntent = new Intent(this, TestimonialText.class);
      textSpec.setContent(textIntent);
  
      tabHost.addTab(videoSpec);
      tabHost.addTab(textSpec);
      for(int i=0;i&lt;tabHost.getTabWidget().getChildCount();i++)
      {
          tabHost.getTabWidget().getChildAt(i).setBackgroundResource(R.drawable.tabdrawable);
      }
      tabHost.getTabWidget().setDividerDrawable(R.drawable.footer_saprater);
  }
  }
  </code></pre>
  
  <p>here is my testimonial.xml code</p>
  
  <pre><code>&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@android:id/tabhost"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
  
  &lt;RelativeLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
  
      &lt;FrameLayout
          android:id="@android:id/tabcontent"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_alignParentTop="true"
          android:layout_above="@android:id/tabs"/&gt;
  
      &lt;TabWidget
          android:id="@android:id/tabs"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:background="@drawable/tabdrawable"
          android:gravity="center_vertical|center_horizontal" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;/TabHost&gt;
  </code></pre>
  
  <p>and here is testimonial_tab_row.xml code</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/tabsLayout" 
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:padding="10dip" 
   android:gravity="center" 
   android:orientation="vertical"&gt;
   &lt;TextView android:id="@+id/tabVideo" 
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Video"
      android:gravity="center"
      android:textSize="22sp"
      android:textColor="#fff" /&gt;
  
   &lt;TextView android:id="@+id/tabText" 
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Text"
      android:gravity="center"
      android:textSize="22sp"
      android:textColor="#fff" /&gt;
   &lt;/LinearLayout&gt;
  </code></pre>