我已經關閉了我的適配器類中的數據庫,所以whay是在logcat上顯示的這個錯誤,但是我的應用程序不是forcr關閉的,但是隻有錯誤顯示在日誌cat..where中,我必須關閉數據庫以忽略此錯誤。 ..?什麼是「SQLiteDatabase創建並從未關閉」的錯誤?
我的錯誤... below..in哪個類我離開關閉數據庫.....我把幫助從這個鏈接http://www.vogella.de/articles/AndroidSQLite/article.html
ERROR/Database(265): Leak found
ERROR/Database(265): java.lang.IllegalStateException: /data/data/expenceanywhere.mobile/databases/data SQLiteDatabase created and never closed
ERROR/Database(265): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1581)
ERROR/Database(265): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)
ERROR/Database(265): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:659)
ERROR/Database(265): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:652)
ERROR/Database(265): at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)
ERROR/Database(265): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
ERROR/Database(265): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
ERROR/Database(265): at expenceanywhere.mobile.NotesDbAdapter.open(NotesDbAdapter.java:56)
ERROR/Database(265): at expenceanywhere.mobile.AddEditExpense.onCreate(AddEditExpense.java:199)
ERROR/Database(265): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
ERROR/Database(265): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
ERROR/Database(265): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
ERROR/Database(265): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
ERROR/Database(265): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
ERROR/Database(265): at android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/Database(265): at android.os.Looper.loop(Looper.java:123)
ERROR/Database(265): at android.app.ActivityThread.main(ActivityThread.java:4203)
ERROR/Database(265): at java.lang.reflect.Method.invokeNative(Native Method)
ERROR/Database(265): at java.lang.reflect.Method.invoke(Method.java:521)
ERROR/Database(265): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
ERROR/Database(265): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
ERROR/Database(265): at dalvik.system.NativeStart.main(Native Method)