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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:35:41+00:00 2026-05-23T20:35:41+00:00

all i am working on one application in which i have to used database.

  • 0

all

      i am working on one application in which i have to used database.

In that i used static cursor and return the cursor.in onDestroye() i am closing the cursor but my question is that i am using cursor as a static so problem is that when i run the application and use cursor first time it not show me the error but accessing a cursor second time it shows the error like this :

Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.technosoft.listia/databases/Listia, table = null, query = select * from Browser where id=2
07-20 12:37:02.292: ERROR/Cursor(588): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
07-20 12:37:02.292: ERROR/Cursor(588): at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:210)
07-20 12:37:02.292: ERROR/Cursor(588): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)
07-20 12:37:02.292: ERROR/Cursor(588): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
07-20 12:37:02.292: ERROR/Cursor(588): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)
07-20 12:37:02.292: ERROR/Cursor(588): at com.technosoft.listia.DataBaseListia.SelectBrosertab(DataBaseListia.java:103)
07-20 12:37:02.292: ERROR/Cursor(588): at com.technosoft.browserTab.BrowserCategoryList.ListviewDisplayMrthod(BrowserCategoryList.java:356)
07-20 12:37:02.292: ERROR/Cursor(588): at com.technosoft.browserTab.BrowserCategoryList$1.handleMessage(BrowserCategoryList.java:347)
07-20 12:37:02.292: ERROR/Cursor(588): at android.os.Handler.dispatchMessage(Handler.java:99)
07-20 12:37:02.292: ERROR/Cursor(588): at android.os.Looper.loop(Looper.java:123)
07-20 12:37:02.292: ERROR/Cursor(588): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-20 12:37:02.292: ERROR/Cursor(588): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 12:37:02.292: ERROR/Cursor(588): at java.lang.reflect.Method.invoke(Method.java:521)
07-20 12:37:02.292: ERROR/Cursor(588): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-20 12:37:02.292: ERROR/Cursor(588): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-20 12:37:02.292: ERROR/Cursor(588): at dalvik.system.NativeStart.main(Native Method)

how can i get rid from this…
please help me as early as possibe

Thank you……

  • 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-23T20:35:42+00:00Added an answer on May 23, 2026 at 8:35 pm

    when you start your application its start with the oncreate method and as you declare the cursor as static so when you back the onDestroy method was invoked and cursor was closed.

    now second time it start with the onResume method so at that time the cursor was closed so at query time it will not open you need to open that cursor again.

    to maintain that cursor call this startManagingCursor(Cursor object) after initialize the cursor so it will manage by the application you don’t need to explicitly close the cursor

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

Sidebar

Related Questions

One long term project I have is working through all the exercises of SICP.
I'm used to doing all my coding in one C file. However, I'm working
Possible Duplicate: Schema for a multilanguage database I'm working on a web application that
I am working with an application that is used by multiple clients. Each client
I have an application which is used for data analysis and I'm having a
HI All, I m working on one application in android. On the Home screen
I'm working on one multi-tenancy application, where each tenant will have access to 1
I have an monotouch application that includes an objective-c static library. The application runs
The question really says it all. For one project I am working on, the
All, I'm working on a SharePoint project, but this isn't a SharePoint-specific question per-se.

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.