I\'ve been looking for hours on how to get all TableRow\'s in a TableLayout. I already know how to add and delete rows dynamically, but I need to loop over all the rows and sele
Have you tried using getChildCount() and getChildAt(int) respectively?
Should be fairly easy in a loop:
for(int i = 0, j = table.getChildCount(); i < j; i++) {
View view = table.getChildAt(i);
if (view instanceof TableRow) {
// then, you can remove the the row you want...
// for instance...
TableRow row = (TableRow) view;
if( something you want to check ) {
table.removeViewAt(i);
// or...
table.removeView(row);
}
}
}