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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:07:37+00:00 2026-05-26T11:07:37+00:00

i have made a few multi activity database applications using sqlite, but i get

  • 0

i have made a few multi activity database applications using sqlite,
but i get error messages in logcat like

Finalizing a Cursor that has not been deactivated or closed
or database not closed error

my apps seems to run fine.
i tried to close cursor and database using the onDestroy or after query or on changing activity,
but then either the application crashes or i get null pointer exception or an empty listview.

i would like to know what problems i can face if i just leave things as it is,
like database corruption or interfrence with other applications.

also i want to know if suppose i declare cursor

protected Cursor a_cursor;

in 1st activity, do i need to use the same declaration in the next activity
or do i need to use

protected Cursor b_cursor;

similarly for DbHelper,Context,Sqlitedatabase etc in 1st activity like

 private SQLiteDatabase adb;
 private DatabaseHelper aDbHelper;
    private final Context aCtx; 

to

 private SQLiteDatabase bdb;
 private DatabaseHelper bDbHelper;
    private final Context bCtx;

in 2nd activity

the structure of the program is like this

DatabaseHelper — to create some tables or upgrade

DbAdapter — to insert or update tables

Activity1 — search a table and listview — on list itemclick –Activity2 ,
context menu to add some details to 2nd table

Activity2 — item details and button for Activity3

Activity3 — Edit item — return

Activity4 — 2nd table listview

Activity5 — Database import export

sorry if my question seems too ametuerish or primitive
but i am not a programmer and the apps are for my personal use
not intended for the market

actually i did not find a complete example to suit my needs
so i just added bits and peices from many examples to get things done

  • 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-26T11:07:38+00:00Added an answer on May 26, 2026 at 11:07 am

    It used to be that we’d say to use managedQuery to deal with this stuff. But since the CursorLoader was added, I suggest using that to keep everything straight. The cursor loader wasn’t added until API Level-10, but you can still use it on lesser API levels through the Support Package.

    For an example of using a CursorLoader, you can checkout this Example (or the corresponding full-fledged example.)

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

Sidebar

Related Questions

I have just started programming and have made a few small applications in C
I made a similar question a few days ago, but now I have new
I'm new to the Windows Mobile scene, but I have made a few Symbian
Have been learning ASP.NET (using C#) over the past few days. I have made
I have made a Win Form and have a few controls like checkboxes, radio
I have been using jqGrid for a few months now, and I have made
I have made a generic handler (.ashx) to fetch some database values using jquery
I have made a SVG image, or more like mini application, for viewing graphs
I have made a new windows service which works fine using barebone code (just
On my Drupal site, I have made a Users page using the Views module,

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.