Is it possible to bind a TableLayout with a ArrayAdapter?
Asked
Active
Viewed 1.7k times
1 Answers
28
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));
}

Romain Guy
- 97,993
- 18
- 219
- 200
-
3Thanks for your response. How do i ensure that the views are getting recycled as that of the convert View? – Manish Khot Feb 18 '11 at 09:43
-
11You can't unless you are willing to reimplement a view recycler like ListView's, and trust me, it's a lot of work you don't want to do :p – Romain Guy Feb 18 '11 at 10:05