How to create a normal table?

Don't know how to generate the table, tried TableLayout
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R. layout.activity_main);
 stroka = (TextView) findViewById(R.id.info);
 TableLayout tableLayout = new TableLayout(this);
 tableLayout.setLayoutParams(new TableLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.Wrap content
));
tableLayout.setStretchAllColumns(true);
 try {
 TextView textView[] = new TextView[9];
 TableRow tableRow[] = new TableRow[3];
 for (int i = 0; i < 9; i++) {
 textView[i] = new TextView(this);
 textView[i].setText("Stroka" + i);
}

 int l = 0;
 for (int i = 0; i < 3; i++) {
 tableRow[i] = new TableRow(this);
 for (int j = 0; j < 3; l++, j++) tableRow[i].addView(textView[l]);
}
 for (int i = 0; i < 3; i++) {
tableLayout.addView(tableRow[i]);
}
setContentView(tableLayout);
 }

But the problem is that it creates the same number of rows and columns, and I need a table with 4 rows of 7 tables. Prompt in what side to dig.
July 4th 19 at 23:59
0 answer

Find more questions by tags AndroidJava