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 6385221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:52:21+00:00 2026-05-25T02:52:21+00:00

i am displaying the database in a listview in android. i am displaying the

  • 0

i am displaying the database in a listview in android. i am displaying the listview in another activity. i am creating database in oncreate by just calling a class called “data” that extends sqliteopenhelper and passing the table but as soon as i launch the app the stack trace in DDMS is

08-23 14:29:07.771: ERROR/Database(5175): Leak found
08-23 14:29:07.771: ERROR/Database(5175): java.lang.IllegalStateException: /data/data/com.cortes/databases/location.db SQLiteDatabase created and never closed
08-23 14:29:07.771: ERROR/Database(5175):     at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1792)
08-23 14:29:07.771: ERROR/Database(5175):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:798)
08-23 14:29:07.771: ERROR/Database(5175):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:857)
08-23 14:29:07.771: ERROR/Database(5175):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:850)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:539)
08-23 14:29:07.771: ERROR/Database(5175):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
08-23 14:29:07.771: ERROR/Database(5175):     at com.cortes.Cortes.onCreate(Cortes.java:79)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-23 14:29:07.771: ERROR/Database(5175):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 14:29:07.771: ERROR/Database(5175):     at android.os.Looper.loop(Looper.java:123)
08-23 14:29:07.771: ERROR/Database(5175):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-23 14:29:07.771: ERROR/Database(5175):     at java.lang.reflect.Method.invokeNative(Native Method)
08-23 14:29:07.771: ERROR/Database(5175):     at java.lang.reflect.Method.invoke(Method.java:521)
08-23 14:29:07.771: ERROR/Database(5175):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
08-23 14:29:07.771: ERROR/Database(5175):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
08-23 14:29:07.771: ERROR/Database(5175):     at dalvik.system.NativeStart.main(Native Method)
08-23 14:29:07.846: ERROR/wpa_supplicant(2300): wpa_driver_priv_driver_cmd failed
08-23 14:29:07.846: ERROR/wpa_supplicant(2300): wpa_driver_priv_driver_cmd failed

and my code is

db = this.openOrCreateDatabase("location.db", SQLiteDatabase.OPEN_READWRITE, null);
d = new data(this,Geo_Create_Table);
db=d.getWritableDatabase();
  • 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-25T02:52:21+00:00Added an answer on May 25, 2026 at 2:52 am

    As I don’t have enough reputation to put a comment yet >.< I’m gonna put this as an answer instead.

    The stack trace contains this SQLiteDatabase created and never closed which leads me to believe that the database was never closed. I’m assuming that Android is griping about the three lines here
    db = this.openOrCreateDatabase(“location.db”, SQLiteDatabase.OPEN_READWRITE, null);
    d = new data(this,Geo_Create_Table);
    db=d.getWritableDatabase();
    and since thats all that you provided I think you think the same. If I understand what this is trying to do, you are opening a locally stored Database db and then, I guess d is also referencing the same locally stored Database. MAYBE (not too sure) that is causing the memory leaks in your app, but one thing I do know is that you need to add the db.close() in there somewhere.

    You could try the suggestion that this other user made by using a try {} finally{db.close()}
    Need help with Database Access in Android

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

Sidebar

Related Questions

My scenario: I am populating a ListView in an activity that is displaying a
I have a custom CursorAdapter that is taking items from a database and displaying
I am displaying the database table values using data tables. I am doing this
I am creating one sample application in which i am reading database and displaying
I'm displaying entries from SQLite database in Expandable ListView and everything is working correctly
I have a class A which extends Activity. From the class A ,I am
We have an MS Access 2007 database with a simple form displaying table data.
I am displaying integer data from an SQLite database using a SimpleCursorAdaptor. Everything shows
I have a list of data coming from the database and displaying in a
I am reading some datas from database and displaying it in a listview.After deleting

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.