Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6629499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:16:11+00:00 2026-05-25T22:16:11+00:00

I have closed the database in my adapter class, so whay is this error

  • 0

I have closed the database in my adapter class, so whay is this error showingup on logcat but my application is not forcr closing but only error is showing on log cat..where i shuold have to close the database for ignoring this error…?

my errors are…below..in which class i left for closing the database…..i took help from this link 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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:16:12+00:00Added an answer on May 25, 2026 at 10:16 pm

    Remember to always close db in Helper class

    //---closes the database---    
    public void close() 
    {
        DBHelper.close();
    }
    

    The similar question: Sqlite Database LEAK FOUND exception in android?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a field with enums: 'preview','active','closed' When I query like this: $query =
Closed as exact duplicate of this question . I have an array/list of elements.
I have an MFC application, which i don't want to be closed during the
I have a closed source application which put a 13 character long timestamp in
I have a Database class that abstracts the ExecuteNonQuery() and ExecuteReader() of SqlCommand. Due
Nothing shows at LogCat, so i have no ideia of the error, hero goes
I have a database contact application.And i want to display my contact details in
I have a list view populated by an adapter reading from SQLite database. When
To implement database access in my application I followed Lars Vogel tutorial , but
I have a main activity which user a viewpager and a database adapter to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.