Manish Khot
Manish Khot

Reputation: 3037

Is it possible to bind a TableLayout with a ArrayAdapter?

Is it possible to bind a TableLayout with a ArrayAdapter?

Upvotes: 14

Views: 17672

Answers (1)

Romain Guy
Romain Guy

Reputation: 98511

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));
}

Upvotes: 28

Related Questions