I'm trying to build a table in android dynamically. But when I attempt to inflate a view, for instance, table_cell.xml, and add it to my table row, nothing appears:
TableLayout tableLayout = (TableLayout)rootView.findViewById(R.id.tableLayout);
View tableCell = getActivity().getLayoutInflater()
.inflate(R.layout.table_cell, container, false);
TableRow tableRow = new TableRow(getActivity());
tableRow.addView(tableCell);
tableLayout.addView(tableRow);
On the other hand, if I just create a TextView manually, then add it to the row, it seems to work fine. Can anyone help me figure out why adding an inflated layout doesn't work?