1

Closing DataSource and Using Cursor

view story
linux-howto

http://stackoverflow.com – 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 (HowTos)