0

A table has 3 columns. and rows keep on increasing dynamically. I want to display the 1 row data in 1 textview.

So If there are 5 rows, I want to dynamically create 5 textviews and insert data into them.

What is the logic for dynamically creating textviews based on upon the row count?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • Possible duplicate of [Android - Dynamically Add Views into View](http://stackoverflow.com/questions/6216547/android-dynamically-add-views-into-view) – OneCricketeer Oct 08 '16 at 09:01
  • You don't really the layout inflater... And an adapter is probably want you really should use, but `LinearLayout.addView` also works – OneCricketeer Oct 08 '16 at 09:02

1 Answers1

0

in these cases you better use listview or recyclerView. you need to make an adapter for them to populate each row's view and data of the view.

this way the data would be shown dynamically. you can see the instruction to use listview in below:

http://www.vogella.com/tutorials/AndroidListView/article.html

Amir Ziarati
  • 14,248
  • 11
  • 47
  • 52