at android.database.sqlite.sqliteClosable.acquireReference(sqliteClosable.java:55)
at android.database.sqlite.sqliteQuery.fillWindow(sqliteQuery.java:58)
at android.database.sqlite.sqliteCursor.fillWindow(sqliteCursor.java:152)at android.database.sqlite.sqliteCursor.onMove(sqliteCursor.java:124)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:214)
at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245)
at com.example.invite.dao.AddGroupDao.findPart(AddGroupDao.java:97)
at com.example.invite.MainActivity$2.run(MainActivity.java:96)
原文:while (cursor.moveToNext()) {
MyGroupInfo myGroupInfo = new MyGroupInfo();
String groupname = cursor.getString(0);
// myGroupInfo.setGroupName(cursor.getString(0));
myGroupInfo.setGroupName(groupname);
myGroupInfos.add(myGroupInfo);
cursor.close();
db.close();
看了一下,原来我的sqliteDatabase对象关闭放在了while的里面。以至于报错了。所以解决方法就是把他们放到外面去,记得要关闭,但位置要看清。这篇小博文就作为自己开始真正工作的起点,也方便自己回忆学习。
原文链接:https://www.f2er.com/sqlite/198950.html