I have an SQL database that I am dynamically adding rows and columns to.
I want to display the data in the SQL database onto a ListView of LinearLayouts, but since the rows and columns are growing and shrinking dynamically, I am going to need to build the layout dynamically in my code.
Is there a way to use a SimpleCursorAdapter to map the data into my layout? Or can the SimpleCursorAdapter only be used on statically defined XML layouts?
Um, OK.
Unless you have limits on the number of columns, this may be difficult.
Only if there is a reasonable maximum number of columns. In that case, as @Maximus suggests, you can hide unused columns using
View.GONE. Otherwise, you are better served usingCursorAdapterand overridingnewView()andbindView()accordingly.