2011-08-14 43 views
0

嗨,所有即時通訊有這個問題....任何人都可以告訴我是什麼原因造成的問題.... ????android完成一個尚未被停用或關閉的光標

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

您的來電 「查詢」,在com.meme.whatami.elhgsdatabase.getAllInfo(elhgsdatabase.java:157)調用之後:

cursor.close(); 
+0

這行是因爲線157是DBHelper內....? – moe

+0

公共光標getAllTitles() { 返回db.query(DATABASE_TABLE,新的String [] { \t \t KEY_ROWID, \t \t KEY_bookNO, \t KEY_TIMEFROM, \t KEY_TIMETO, \t KEY_LINK, \t KEY_bookLINK, \t KEY_bookTIME , \t KEY_C1, \t KEY_C2, KEY_C3 }, null, null, null, null, null); } – moe

+0

那麼,你正在返回一個你在其他地方使用的遊標。完成使用後(在getAllTiles調用之後),然後關閉它。 –

相關問題