how can I do to pass an ArrayList to a cursor with its fields
how can I do to pass an ArrayList to a cursor with its fields
One option would be using MatrixCursor , adding the values of the ArrayList
within the cursor.
MatrixCursor myMatrixCursor = new MatrixCursor(myArrayList.size());
startManagingCursor(myMatrixCursor);
//Agrega valores de ArrayList en el Cursor.
matrixCursor.addRow(new Object[] {myArrayList.get(0), myArrayList.get(1), myArrayList.get(2), myArrayList.get(3), ..... });
Then we add the values to the cursor from the created MatrixCursor.
MergeCursor mergeCursor = new MergeCursor(new Cursor[] { matrixCursor, cursor });
I think you can use MatrixCursor
. It is a Cursor implementation, it is mutable and you can use newRow()
to add new rows.
I hope it serves you, sorry I have not tried it.