Refresh tableLayout
<p>Hi I have a tableLayout and am populating the layout with ImageView[][] using a nested for loop. I'm currently trying to click on an ImageView and rearrange the ImageView[][] data then refresh the screen to reflect the rearrangement. Is there a way to do this? Apparently I can't call the setContentView more than once.</p>

<p>Edit: you can see this is the code for the onclick event. I setContentView of the original TableLayout ('tl') in the onCreate event and can't call it again here. </p>

<pre><code>public void onClick(View v) {
    // TODO Auto-generated method stub
    switch(v.getId()){
    case 1: 
        image_array = switchTile(image_array, 2,1,0,0);
        Toast.makeText(this, "1 clicked!", Toast.LENGTH_LONG).show();

    }

    tl.removeAllViewsInLayout();

    for(int i = 0; i &lt; level; i++){
        TableRow new_tr = new TableRow(this);
        new_tr.setLayoutParams(layout_image);

        for(int j = 0; j&lt; level; j++){
            new_tr.addView(image_array[i][j]);
        }
        tl.addView(new_tr);
    }

    tl.invalidate();

}
</code></pre>
