I have a general question regarding Android's separation of layouts into layout.xml files:
My app needs to display a table where the number of rows and columns varies at runtime. So far I did the layout up to the TableView in the corresponding layout/....xml file and then I added TableRow-s and cells (TextView) to the table at runtime as needed. The drawback of adding rows and cell programmatically is, that one can not really change the design later (e.g. changing colors or margins for the cells) without later code modification.
What I would this like to do is to add a single row to the table and a single cell to the row in the layout file and then use these as a "pattern" or templates to generate all the actual table's rows and cells. This would allow to specify colors and other parameters in the layout.xml file (and thus also be able to change them later without code change) but still allow for an arbitrary number of columns and cells.
However, I found no "copy"-constructor or "duplicate"-method in Views. How can one achieve this? What is the suggested method to create lists or tables from a single "example" or template element? Or is there another method to achieve what I want?
Hope I could make myself clear... Michael