i want to create the table dynamically , now the number of rows and columns are saved in the respective integer variables. please tell me the way i can create the table programatically in android because number of rows and columns are not fixed .
what i tried so far is below...
is there any method to create table with given dimensions(rows and columns)?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TableLayout tl = (TableLayout)findViewById(R.id.tableLayout1);
TableRow row = new TableRow(this);
TextView tv = new TextView(this);
tv.setText("This is text");
tl.addView(row);
row.addView(tv);
}