Sourabh Sourabh - 1 year ago 43
Android Question

how to delete table row in table layout in android

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);
tl.addView(tr1,new TableLayout.LayoutParams(layoutParams));

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...


Answer Source

Try removeView

row = (TableRow)findViewById(;