I\'m trying to make a 3-column TableLayout but I never see anything. Here\'s my java code:
TableLayout tl = (TableLayout)findViewById(R
Your TextViews are children of a TableRow so you should set an instance of TableRow.LayoutParams for the LayoutParams instead of the simple one(probably from the ViewGroup super class) that you currently use:
//...
TextView tv = new TextView(this);
tv.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.WRAP_CONTENT));
tv.setText("text 1");
tr.addView(tv);
TextView tv1 = new TextView(this);
tv1.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.WRAP_CONTENT));
tv1.setText("text 2");
tr.addView(tv1);
TextView tv2 = new TextView(this);
tv2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.WRAP_CONTENT));
tv2.setText("text 3");
tr.addView(tv2);
//...