android 中的动态表格布局,其中应在下一次迭代开始之前清除行

dynamic tablelayout in android in whice the rows should be cleared for before the start of next iteration

我在我的 android 应用程序中创建了一个动态 TableLayout,其中的行在每次迭代时都会发生变化。对于第一次迭代,它显示来自 XML 响应的数据,而对于第二次迭代,它必须仅显示更新后的 XML 响应。但在我的例子中,它是从迭代 1 _iteration 中获取数据。如何在 android

中开始加载下一次迭代之前清除 table 行

我们可以参考这个answer

您可以在 TableLayout 对象上调用 removeAllViews() 方法。 例如,tableLayout.removeAllViews().