I have a problem with the following code:

```
TextView[] tx = new TextView[10];
TableRow[] tr = new TableRow[10];
final TableLayout tl = (TableLayout)findViewById(R.id.maintable);
for(i = 0; i < 10; i++)
            {
                tx[i] = new TextView(TransactionsActivity.this);
                tx[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
                tx[i].setText(Dates1);
                tr[i] = new TableRow(TransactionsActivity.this);
                tr[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
                tr[i].addView(tx[i]);
                tl.addView(tr[i], new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            }

```

What I am trying to do is to dynamically add textview to a table row or layout. But this code does nothing when I run it, no errors though.

My XML code is as follows:

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@drawable/energy">
   <ScrollView
    android:id="@+id/scrllvwNo1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
  <RelativeLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
  <!--  Screen Design for VIDEOS -->
  <TextView android:id="@+id/textview1"
              android:text="Transactions page"
              android:padding="15dip"
              android:textSize="18dip"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"/>
  <Button
              android:id="@+id/button"
              android:text="Clear Transactions"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_toRightOf="@id/textview2"
              android:layout_below="@id/textview1"/>
  <TextView android:id="@+id/textview2"
              android:text=""
              android:padding="15dip"
              android:textSize="18dip"
              android:layout_width="0dip"
              android:layout_height="0dip"
              android:layout_centerHorizontal="true"/>          
  <Button android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Get Transactions"
            android:layout_toLeftOf="@id/textview2"
            android:layout_alignTop="@id/button"/>          
  <TextView android:id="@+id/textview"
              android:text=""
              android:padding="0dip"
              android:textSize="0dip"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_below="@id/button"/>

<HorizontalScrollView android:id="@+id/horz"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_below="@id/textview">            
  <TableLayout android:id="@+id/maintable" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="4"
    android:layout_below="@id/horz">

    <TableRow>
        <TextView
            android:id="@+id/textview1"
            android:layout_column="1"
            android:text="Date"
            android:padding="15dip" />
        <TextView
            android:id="@+id/textview2"
            android:layout_column="2"
            android:text="Device"
            android:layout_toLeftOf="@id/textview1"
            android:padding="15dip" />
        <TextView
            android:id="@+id/textview3"
            android:layout_column="3"
            android:text="Access Type"
            android:layout_toLeftOf="@id/textview2"
            android:padding="15dip" />
        <TextView
            android:id="@+id/textview4"
            android:layout_column="4"
            android:text="Area"
            android:layout_toLeftOf="@id/textview3"
            android:padding="15dip" />                        
    </TableRow>

    <View
        android:layout_height="2dip"
        android:background="#FF909090" />

</TableLayout>
</HorizontalScrollView>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

```