title: table row when added dynamically not showing android
body: <p>when m trying to add a row in table layout from java code(dynamically). Read many questions in here but couldnot get the solution out.
  xml layout is</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      tools:context=".PlannedDeliveries" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:background="#C0C0C0"
          android:gravity="center_horizontal"
          android:text="Store ID:1245 Store:NYC"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TableLayout
          android:id="@+id/tablePD1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@+id/textView1"
          android:layout_marginTop="30dp"
          android:background="#E0E0E0"
          android:orientation="vertical" &gt;
  
          &lt;TableRow
              android:id="@+id/tableRow1"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/table1"
              android:layout_centerHorizontal="true"
              android:background="#E0E0E0" &gt;
  
              &lt;TextView
                  android:id="@+id/textView2"
                  android:layout_width="100dip"
                  android:layout_height="wrap_content"
                  android:gravity="left"
                  android:padding="5dip"
                  android:text="Doc No" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="left"
                  android:padding="5dip"
                  android:text="Doc
  Type" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView4"
                  android:layout_width="120dip"
                  android:layout_height="wrap_content"
                  android:gravity="left"
                  android:padding="5dip"
                  android:text="Source" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView4"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="left"
                  android:padding="5dip"
                  android:text="Qty" /&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>and java code is</p>
  
  <pre><code>Log.v(LOG_TAG, "in create table row method");
          TableLayout tlPD = (TableLayout) findViewById(R.id.tablePD1);
  
          /*tlPD.removeView(tlPD);
          Log.v(LOG_TAG, "removing the view from table");
          */
          Log.v(LOG_TAG, "before adding values to table row first in method");
          //adding 1st  row in table
  
  
  
          //1st row,,,,
  
          TableRow trPD = new TableRow(this);
          LayoutParams lp1 = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
          trPD.setLayoutParams(lp1);
          TextView r1c1 = new TextView(this);
          r1c1.setLayoutParams(lp1);
          r1c1.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r1c1.setText(Html.fromHtml("3000000088"+"&lt;br&gt;"));
          TextView r1c2 = new TextView(this);
          r1c2.setLayoutParams(lp1);
          r1c2.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r1c2.setText(Html.fromHtml("Tsf "+" &lt;br&gt;"));
          TextView r1c3 = new TextView(this);
          r1c3.setLayoutParams(lp1);
          r1c3.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r1c3.setText(Html.fromHtml("Store ID:1247" + "&lt;br&gt; (Kingston Store) " ));
  
          TextView r1c4 = new TextView(this);
          r1c4.setLayoutParams(lp1);
          r1c4.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r1c4.setText(Html.fromHtml("4"+"&lt;br&gt;"));
          trPD.addView(r1c1);
          trPD.addView(r1c2);
          trPD.addView(r1c3);
          trPD.addView(r1c4);
  
          Log.v(LOG_TAG, "row1 coloumn1" +r1c1);
          Log.v(LOG_TAG, "row1 coloumn2" +r1c2);
          Log.v(LOG_TAG, "row1 coloumn3" +r1c3);
          Log.v(LOG_TAG, "row1 coloumn4" +r1c4);
  
  
  
          tlPD.addView(trPD, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
  
  
          Log.v(LOG_TAG, "after adding values to table row first in method");
          Log.v(LOG_TAG, "before adding values to table row second in method");
  
          //adding 2nd  row in table
          TableRow trPD1 = new TableRow(this);
          LayoutParams lp2 = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
          trPD1.setLayoutParams(lp2);
          TextView r2c1 = new TextView(this);
          r2c1.setLayoutParams(lp2);
          r2c1.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r2c1.setText(Html.fromHtml("4568"+"&lt;br&gt;"));
  
          TextView r2c2 = new TextView(this); 
          r2c2.setLayoutParams(lp2);
          r2c2.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r2c2.setText(Html.fromHtml("PO "+" &lt;br&gt;"));
          TextView r2c3 = new TextView(this);
          r2c3.setLayoutParams(lp2);
          r2c3.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r2c3.setText(Html.fromHtml("Supp ID:2346" + "&lt;br&gt; (Sony Corp) " ));
          TextView r2c4 = new TextView(this);
          r2c4.setLayoutParams(lp2);
          r2c4.setBackgroundColor(getResources().getColor(R.color.lightGray));
          r2c4.setText(Html.fromHtml("5"+"&lt;br&gt;"));
          trPD1.addView(r2c1);
          trPD1.addView(r2c2);
          trPD1.addView(r2c3);
          trPD1.addView(r2c4);
  
          tlPD.addView(trPD1, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
  
          Log.v(LOG_TAG, "row2 coloumn1" +r2c1);
          Log.v(LOG_TAG, "row2 coloumn2" +r2c2);
          Log.v(LOG_TAG, "row2 coloumn3" +r2c3);
          Log.v(LOG_TAG, "row2 coloumn4" +r2c4);
  
          Log.v(LOG_TAG, "after adding values to table row second in method");
  </code></pre>
  
  <p>please help me out kinda stuck..thnx in advance.</p>