Say I have a SQLite Database in my Assets folder of my Android app with data in a similar structure to the following table:
As you can see there are some (highlighted) blank fields. I will have a listview activity that will list the data in the NAME
column. When one is clicked it will pass the ID to a second activity, which will show the data from the related record by querying that record from the table and putting it in some form of array possibly.
How would I turn this data (ignoring the image field) into a tableview? So far, I have just converted it all into a normal tableview, but I would like to hide the blank columns if they are blank, so it is sort of a dynamic table, so that some tables will have more rows than others, as it will be converted into a tableview with two columns, one column for field name, and the second for the data stored in that field for the chosen record.
So if ID 1 was selected from the listview, the tableview would look something like this:
Whereas the tableview would look like this if ID 3 was selected:
Thanks.
Aucun commentaire:
Enregistrer un commentaire