Is it possible to bind a TableLayout with a ArrayAdapter?
Asked
Active
Viewed 1.6k times
1 Answers
27
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));
}
![](../../users/profiles/298575.webp)
Romain Guy
- 95,351
- 17
- 214
- 199
-
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
-
10You 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