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

  • Home
  • SEARCH
  • 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 8747495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:21:55+00:00 2026-06-13T12:21:55+00:00

I am new to android.Is there any statements are available for checking whether cursor

  • 0

I am new to android.Is there any statements are available for checking whether cursor object and database is closed or not.
I have two activities A & B.when i perform certain actions in A,it will go to B.Database object and cursor object of A are closed in the Activity A.when i press the back button when i am in B,the activity gets force closed.I have understood this error is due to closing of my cursor object.Is there any way to reopen the cursor & database object or can we check whether both are closed or not.if so,please help me.

my logcat view is present below:

10-25 16:02:15.152: ERROR/AndroidRuntime(458): Caused by:java.lang.IllegalStateException: attempt to re-open an already-closed object: android.database.sqlite.SQLiteQuery (mSql = SELECT * FROM tbl_sec) 
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:34)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:64)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:283)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:255)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:188)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at com.nagainfo.firstAp.showTime.onResume(showTime.java:84)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.app.Activity.performResume(Activity.java:3823)
10-25 16:02:15.152: ERROR/AndroidRuntime(458):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
  • 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-06-13T12:21:56+00:00Added an answer on June 13, 2026 at 12:21 pm

    For closing the database instance, do like this before exiting the activity:

    if(db.isOpen()){
        db.close();
    }
    

    For checking whether Cursor is available or not, do like this:

    if (cursor1.isClosed())
        //Do something here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm new at Android world, and i have a doubt, is there any method
I am very new to android.I have set spinner SetOnItemSelected Listener. Is there any
I know this is the list of permissions in android Is there any new
Is there any way, how to get new x86 image for Android emulator working
Is there any sample? I have my android application and I need to connect
Is there any good tutorial available to learn how to use the android layout
I'm new to Android. I have two activities. First activity shows selected contact list
I am new in android so please help me is there any way to
In android,Is there any differences between the following code? new Intent(this, MyOtherActivity.class); new Intent(Context.this,
I'm new in Android and I would like to ask you is there any

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.