void init()
{
intcolumnwidth1 = int_scr_wd*55;
intcolumnwidth1 = intcolumnwidth1/100;
for (int i = 0; i < strarr.length-1; i++)
{
strinarr = fun1.split(strarr[i].trim(),"^");
tr1 = (TableRow) new TableRow(this);
txt1=new TextView(this);
txt1.setWidth(intcolumnwidth1);
txt1.setText(strinarr[0]);
tr1.addView(txt1);
tl.addView(tr1,new TableLayout.LayoutParams(layoutParams));
}
}
情景是这样的,当为第i打开这个页面是动态地将表中的行布局...但如果以后在数据库更改了一段时间的数据... ...当我点击刷新按钮,追加后的新数据在表格布局旧数据......所有我需要的是如何刷新或删除的TextView已经存在于表中的布局解决方案...
Scenario is this when for the first i open this page it dynamically adds rows in the table layout ... but if after some time data in database changes ... when i click on refresh button it appends the new data after the old data in the table layout... all i need is the solution for how to refresh or delete textview that already exists in the table layout...
感谢名单..
尝试removeView
row = (TableRow)findViewById(R.id.row);
table.removeView(row);
上一篇:乌里转换为字符串转换为、字符串
下一篇:安卓UncaughtExceptionHandler的实例化一个AlertDialog休息实例、UncaughtExceptionHandler、AlertDialog