How to add new row below previous one in tableview
<p>I want to add a new row below previous ones. I mean I have a UI containing 2 text boxes and 1 submit button. When I fill the text box and press submit, the content of text box is added below the previous one. Is this done with listview or tableview? Please give suggestions to me and how to implement that technique. And after item is added in listview and when I click on any of list position, it performs different-2 activity. Please help me, it's urgent. And I am new in Android so discuss deeply.</p>

<pre><code>TextView exampleTextView = (TextView) findViewById(R.id.field1);
exampleTextView.setText("wedwqe");
TableLayout table = (TableLayout)findViewById(R.id.table);
TableRow tr = (TableRow) findViewById(R.id.row);
tr.addView(exampleTextView);
//  table.removeView(tr);
table.addView(tr);
</code></pre>

<p>And the XML file is:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/table"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:layout_gravity="center"
    android:background="#DDDDDD"
    android:stretchColumns="1" &gt;
&lt;TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/row"&gt;

    &lt;TextView android:id="@+id/field1"
        android:text=" "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="3dip"
        android:textStyle="bold"
        android:textSize="18dip"
    /&gt;

    &lt;TextView android:id="@+id/field2"
        android:padding="3dip"
        android:text=" "
        android:textSize="18dip"
        android:gravity="right"
    /&gt;
&lt;/TableRow&gt;
&lt;/TableLayout&gt;
</code></pre>
