handling LinearLayout within a ScrollView
<p>Originally, I had LinearLayout>ScrollView>TableLayout and the code below:</p>

<pre><code>LinearLayout layout = (LinearLayout) View.inflate(this, R.layout.photos_layout, null);
setContentView(layout);
// TODO Auto-generated method stub
//get the tableLayout which we created in main.xml
tl = (TableLayout)findViewById(R.id.tableLayout1);
for(int i = 0; i &lt; names.length; i++) {
    //Create a new row to be added.
    TableRow tr = new TableRow(this);
    //Create text views to be added to the row.
    TextView tv1 = new TextView(this);
    TextView tv2 = new TextView(this);
    //Put the data into the text view by passing it to a user defined function createView()
    createView(tr, tv1, Integer.toString(i+1));
    createView(tr, tv2, names[i]);
    //Add the new row to our tableLayout tl
    tl.addView(tr);
}
</code></pre>

<p>The problem is that a scrollView can only have one child, so if I wanted to add more views in addition to the tableLayout I can't. In order to overcome this problem I made the hierarchy like LinearLayout>ScrollView>linearLayout>tableLayout. However, now the code above crashes the app. </p>

<p>What do I need to change in order to populate my table, as well as add views to my newly created linearlayout?</p>
