Problem in displaying data in the Tablelayout
<p>I have used a TableLayout to display data. Data is in json format so for that I have created dynamic TableRow and TextView with filled data and putted into the TableLayout. In test application I have taken a fix string array to filled the table in place of json. It doesn't matter. </p>

<p>The problem is that all code runs  well without error. Even I have debug each line of code. I didn't find any error. Event then My data is not showing in a table. TableLayout remains blank as in starting.
My code is: </p>

<pre><code>    @Override
public void onCreate(Bundle savedInstanceState) {
    try
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabular_layout);        
        final TableLayout tl = (TableLayout)findViewById(R.id.tblLyt);

        for(int i = 0; i&lt;names.length; i++)
        {

            TableRow tr = new TableRow(this);               
            TextView tv1 = new TextView(this);
            TextView tv2 = new TextView(this);

            createView(tr, tv1, Integer.toString(i+1));
            createView(tr, tv2, names[i]);

            tl.addView(tr);             
        }

    }
    catch(Exception ex)
    {
        MessageBox(ex.getMessage());
    }
}

public void createView(TableRow tr, TextView t, String viewdata) throws Exception{
    try
    {
        t.setText(viewdata);
        t.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
        t.setTextColor(Color.DKGRAY);
        t.setBackgroundColor(Color.WHITE);
        t.setPadding(20, 0, 0, 0);
        tr.setPadding(0, 1, 0, 1);
        tr.addView(t); // add TextView to row.
    }
    catch(Exception ex)
    {
        throw ex;
    }
}
</code></pre>

<p>This is my tabular_layout.xml file.</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent" android:weightSum="1"&gt;
       &lt;TableLayout android:layout_width="fill_parent" android:id="@+id/tblLyt"       android:layout_height="wrap_content" android:layout_weight="0.69"&gt;             
       &lt;/TableLayout&gt;

   &lt;/LinearLayout&gt;
</code></pre>

<p>I am still new in Android. I might done silly mistake. But I tried a lot on this and also searched for that.
So help me !!</p>

<p>Thanks.</p>
