I'am stuck for about 2 hour in order to try to create a TableRow who was multiples infalted layouts in it.My code looks like this:
LayoutInflater inflater = LayoutInflater.from(this);
TableLayout tblLayout = inflater.inflate(R.layout.tblL,parent,false);
TableRow tableRow = (TableRow) tblListItems.findViewById(R.id.tableRow );
View headerCell = inflater.inflate(R.layout.header_col,tblListItems,false);
TextView tvCellName = (TextView) headerCell.findViewById(R.id.tvCellName);
for(String item: items) {
tvCellName.setText(item);
tableRow.addView(tvCellName);
}
relativeLayout2.addView(tblLayout);
The error I get :
The specified child already has a parent. You must call removeView() on the child's parent first.
What I'am doing wrong and how should I do it right ?