Skip to content Skip to sidebar Skip to footer

Fancy Dynamic List In Android: Tablelayout Vs Listview

There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like: Text11 Text12 Button1

Solution 1:

Using ListView and ArrayAdapter you can do more complicated layouts than just a TextView. You could specify a LinearLayout with 2 TextViews and 2 Buttons for each row in the List.

here's a similar question Android: ListView elements with multiple clickable buttons

Solution 2:

IMHO it depends on the amount of your data you need to render.

Build layout dinamically via inflate/addView is a quite simple task but is also more slow than using a custom adapter. with a custom adapter you can reuse the convertView parameter and then set the values more efficiently

Post a Comment for "Fancy Dynamic List In Android: Tablelayout Vs Listview"