问题
I am trying to add row to the cursor (which is done with matrix cursor), then pass the cursor to the list adapter (resource adapter). The list adapter takes only a cursor. How do I add a row to the list adapter?
回答1:
You don't add a row to the list adapter. You just add a row to the matrix cursor like this:
mx.newRow().add(0).add("value of second column").add("value of third column");
mx.newRow().add(1).add("value of second column").add("value of third column");
... etc. Then with a SimpleCursorAdapter you "connect" the MatrixCursor to the ListAdapter
来源:https://stackoverflow.com/questions/4531031/how-to-display-matrix-cursor-using-list-adapter-in-android