Skip to content Skip to sidebar Skip to footer

Unable To Dynamically Populate A Table

I'm trying to fetch data from a database and placing its content in a Table format. I've looked up various tutorials online and structured my code as follows, but it wouldn't show

Solution 1:

Try this

In your createView method

replace this

t.setLayoutParams(newLayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));

with this

 t.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT));

Whenever you are adding layout params while adding view to Table, You have to make sure that your layout params are of TableRow.

Post a Comment for "Unable To Dynamically Populate A Table"