嗨,所有我有这个问题....任何人都可以告诉我是什么导致问题.... ????
08-14 16:50:12.797: ERROR/Cursor(4453): Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.paad.whereami/databases/adrite, table = books, query = SELECT _id, bookno, timeFrom, timeTo, lnk, booklink, dTime, Cbook, Cid, Cdate FROM booksdb
08-14 16:50:12.797: ERROR/Cursor(4453): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:210)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1264)
08-14 16:50:12.797: ERROR/Cursor(4453): at com.meme.whatami.elhgsdatabase.getAllInfo(elhgsdatabase.java:157)
08-14 16:50:12.797: ERROR/Cursor(4453): at com.meme.whatami.WhatAmI$7.run(WhatAmI.java:1331)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.os.Handler.handleCallback(Handler.java:587)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.os.Handler.dispatchMessage(Handler.java:92)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.os.Looper.loop(Looper.java:123)
08-14 16:50:12.797: ERROR/Cursor(4453): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-14 16:50:12.797: ERROR/Cursor(4453): at java.lang.reflect.Method.invokeNative(Native Method)
08-14 16:50:12.797: ERROR/Cursor(4453): at java.lang.reflect.Method.invoke(Method.java:521)
08-14 16:50:12.797: ERROR/Cursor(4453): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-14 16:50:12.797: ERROR/Cursor(4453): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-14 16:50:12.797: ERROR/Cursor(4453): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:0)
在com.meme.whatami.elhgsdatabase.getAllInfo(elhgsdatabase.java:157)中调用“query”后,请致电:
cursor.close();