-1

My app read a surveys questions and answers from file, and its create for this a dynamic table layout. And when my table layout is ready i would like to show this on the screen but its not working. I have a table layout in my activity_main.xml, and i tried this to show my dynamic table on the screen:

tbl = dataManager.getMainTable();

tbl is the table layout in my xml file, and the getMainTable() method return with a TableLayout object, but its not show the table for me.

just
  • 1,900
  • 4
  • 25
  • 46

1 Answers1

0

You are just replacing the value of the tbl variable , but not actually showing it.

You have one table in the xml , but another is returned in the getMainTable()

Get rid of the table in xml , then add the one returned to your container. Say you have a FrameLayout with id mainContainer:

((LinearLayout)findViewById(R.id.mainContainer)).addView(dataManager.getMainTable();); 
Leonardo C
  • 276
  • 2
  • 5