title: SQLite Exception in android
body: <p>hi my application contains SQLite .My application some time getting the following error </p>
  
  <pre><code>java.lang.RuntimeException: Unable to destroy activity {com.fitzsoftware.grocessaryList/com.fitzsoftware.grocessaryList.GrocessaryList}: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
  at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655)
  at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673)
  at android.app.ActivityThread.access$2900(ActivityThread.java:125)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4627)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
  at android.database.sqlite.SQLiteDatabase.dbclose(Native Method)
  at android.database.sqlite.SQLiteDatabase.onAllReferencesReleased(SQLiteDatabase.java:320)
  at android.database.sqlite.SQLiteDatabase.close(SQLiteDatabase.java:881)
  at com.fitzsoftware.grocessaryList.GrocessaryList.onDestroy(GrocessaryList.java:103)
  at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642)
  </code></pre>
  
  <p>I am closing the db in Destroy() using  DataClass.dh.db.close();
  Why this Error occured.Give me the solutions for this.Thanks in advance.</p>