I have a problem in Android
creating a table adding rows dynamically. The error message is:
The specified child already has a parent. You mu
So, you once create tv_item1, tv_item2 and tv_item3. Then in cycle for all ArrayList you adding this views
tr.addView(tv_item1);
tr.addView(tv_item2);
tr.addView(tv_item3);
At the second iteration you already add tv_item1 to tr. And you want to do it again. I guess you need just transfer this lines to cycle:
TableRow tr = new TableRow(this);
tr.removeAllViews();
tr.setPadding(0,10,0,10);
tr.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
TextView tv_item1 = new TextView(this);
TextView tv_item2 = new TextView(this);
TextView tv_item3 = new TextView(this);