title: How to add a fragment inside a table row programmatically?
body: <p>I can achieve this with this xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/startoverviewfragmentLayoutId" &gt;
  
  &lt;TableRow
      android:id="@+id/tableRow1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" &gt;
  
      &lt;fragment
          android:id="@+id/fragment1"
          android:name="com.xxxx.xxx.MyMediaPlayer"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/TableRow&gt;
  
  &lt;TableRow
      android:id="@+id/tableRow2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" &gt;
  &lt;/TableRow&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p>But how can i do it with java code? I tried this:</p>
  
  <pre><code>    MyMediaPlayer mpv = new MyMediaPlayer(); //Fragment
      TableRow tt = (TableRow)myView.findViewById(R.id.tableRow1); 
      tt.addView(mpv);
  </code></pre>
  
  <p>But since a fragment isnt a view this wont work. So how should i do?</p>