I\'m trying to create a TableLayout programatically. It just won\'t work. The same layout in an xml file works though. This is what I have:
public class MyTa
Your problem is at this line:
b.setLayoutParams(new LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
You need to change LayoutParams
to TableRow.LayoutParams
:
b.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT));