Android 动态重新创建表布局
我在OnCreate()中创建了一个动态表布局。每次活动恢复时,表行中的数据都可能更改,因此我希望销毁表行并创建新的表行。 我该怎么做?谢谢 以下是OnCreate表创建部分的外观:Android 动态重新创建表布局,android,dynamic,tablelayout,Android,Dynamic,Tablelayout,我在OnCreate()中创建了一个动态表布局。每次活动恢复时,表行中的数据都可能更改,因此我希望销毁表行并创建新的表行。 我该怎么做?谢谢 以下是OnCreate表创建部分的外观: tableLayout tl = new TableLayout(this); for (i = 0; i < numberOfVariables; i++) { TableRow tr = new TableRow(this); CheckBox cb
tableLayout tl = new TableLayout(this);
for (i = 0; i < numberOfVariables; i++) {
TableRow tr = new TableRow(this);
CheckBox cb = new CheckBox(this);
tr.addView(cb);
TextView dv = new TextView(this);
tr.addView(dv);
EditText et = new EditText(this);
tr.addView(et);
tl.addView(tr);
}
ll.addView(tl);
tableLayout tl=新的tableLayout(此);
对于(i=0;i
只需使用,然后重新创建行