I have a method which essentially does the following:
Cursor cursor; cursor = myCard.queryRandomCard(this); cursor.moveToFirst();
Within the queryRandomCard method:
DataSource datasource = new DataSource(context); datasource.open(); Cursor cursor = (SQL STATEMENT IS HERE AND WORKS); datasource.close(); return cursor;
The problem lay in that, upon retutn I get an error while executing "cursor.moveToFirst()" which says "the connection pool has been closed". HOWEVER, if I remove the "datasource.close()" call, then it works fine.
My question is, why does closing the database here affect the cursor that is returned? Are these two tied together closer than I had realized?