Question

Is it possible to bind a TableLayout with a ArrayAdapter?

Was it helpful?

Solution

There is no such API in the framework. You can do it manually by querying the adapter yourself. Something like this:

int count = adapter.getCount();
for (int i = 0; i < count; i++) {
    tableLayout.addView(createTableRow(adapter.getItem(i)); // or tableLayout.addView(adapter.getView(i, null, tableLayout));
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top