title: "The specified child already has a parent" adding new TableLayout
body: <p>I get this error when I try to add a programmatical created TableLayout to my LinearLayout shown below: </p>
  
  <pre><code>08-09 10:20:26.288: E/AndroidRuntime(1878): Process: de.bc.cologne, PID: 1878
  08-09 10:20:26.288: E/AndroidRuntime(1878): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.bc.cologne/de.bc.cologne.activity.ProtokollActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread.access$800(ActivityThread.java:151)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.os.Handler.dispatchMessage(Handler.java:102)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.os.Looper.loop(Looper.java:135)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread.main(ActivityThread.java:5257)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at java.lang.reflect.Method.invoke(Native Method)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at java.lang.reflect.Method.invoke(Method.java:372)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  08-09 10:20:26.288: E/AndroidRuntime(1878): Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.view.ViewGroup.addViewInner(ViewGroup.java:3936)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.view.ViewGroup.addView(ViewGroup.java:3786)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.widget.TableLayout.addView(TableLayout.java:429)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.view.ViewGroup.addView(ViewGroup.java:3727)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.widget.TableLayout.addView(TableLayout.java:411)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.view.ViewGroup.addView(ViewGroup.java:3700)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.widget.TableLayout.addView(TableLayout.java:402)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at de.bc.cologne.activity.ProtokollActivity.onCreate(ProtokollActivity.java:76)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.Activity.performCreate(Activity.java:5990)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
  08-09 10:20:26.288: E/AndroidRuntime(1878):     ... 10 more
  </code></pre>
  
  <p>Layout - XML:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center_horizontal"
      android:orientation="vertical"
      android:background="#FFFFFF"
      android:id="@+id/linearLayoutProtokoll"
      tools:context="${relativePackage}.${activityClass}" &gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Activity Code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_protokoll);
  
      mLinearLayoutProtokoll = (LinearLayout)findViewById(R.id.linearLayoutProtokoll);
  
      TableLayout.LayoutParams tableParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT);
      TableRow.LayoutParams rowParams = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
  
      TableLayout tableLayout = new TableLayout(this);
      tableLayout.setLayoutParams(tableParams);
  
      TableRow tableRow = new TableRow(this);
      tableRow.setLayoutParams(tableParams);
  
      mTableLayout = new TableLayout(this);
      mTableLayout.setGravity(Gravity.CENTER);
      mTableLayout.setLayoutParams(tableParams);
  
      mFileDataSource = new FileDataSource(this);
      List&lt;Protokoll&gt; lAllProtokoll = mFileDataSource.loadProtokoll();
  
      TableRow lTableRow = new TableRow(this);
      lTableRow.setLayoutParams(tableParams);
      for (Protokoll lProtokoll : lAllProtokoll) {
          TextView lTextViewCreated = new TextView(this);
          lTextViewCreated.setText("date");
          lTextViewCreated.setLayoutParams(rowParams);
          lTableRow.addView(lTextViewCreated);
  
          TextView lTextViewType = new TextView(this);
          lTextViewType.setLayoutParams(rowParams);
          if (lProtokoll.getType() == 0) {
              lTextViewType.setText("INFO");
          } else {
              lTextViewType.setText("ERROR");
          }
          lTableRow.addView(lTextViewType);
  
          TextView lTextViewFile = new TextView(this);
          lTextViewFile.setLayoutParams(rowParams);
          if (lProtokoll.getFile() == null) {
              lTextViewFile.setText("");
          } else {
              lTextViewFile.setText(lProtokoll.getFile());
          }
          lTableRow.addView(lTextViewFile);
  
          TextView lTextViewMessage = new TextView(this);
          lTextViewMessage.setLayoutParams(rowParams);
          lTextViewMessage.setText(lProtokoll.getMessage());
          lTableRow.addView(lTextViewMessage);
  
          mTableLayout.addView(lTableRow);
      }
      mLinearLayoutProtokoll.addView(mTableLayout);
  }
  </code></pre>
  
  <p>I realy dont know whats the problem...
  Could you help me?</p>