【发布时间】:2011-12-19 20:42:00
【问题描述】:
首先,如果我错了,请纠正我,但是如果你关闭一个数据库连接,你就不能使用你从中得到的光标,对吗?
db.open();
Cursor c = db.query(true, "MyTable", columns, null, null, null, null, null, null);
db.close();
// The Cursor is empty now because the db was closed...
c.moveToNext();
Log.v(TAG, c.toString(0));
那么关闭数据库后有什么办法可以使用光标吗?有没有办法将它传递到其他地方并像对象一样使用它?还是您必须始终保持数据库连接打开,直到您完成游标?
【问题讨论】:
标签: java android sqlite android-cursor