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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:33:21+00:00 2026-06-11T03:33:21+00:00

before you ask I have looked around for a solution to my problem and

  • 0

before you ask I have looked around for a solution to my problem and I can’t work it out myself, hence coming to you guys.

THE PROBLEM

I have an uncaught exception problem with my cursor and I cannot work it out….

ERROR

09-04 15:48:38.863: I/dalvikvm(1421): Uncaught exception thrown by finalizer (will be discarded):
09-04 15:48:38.863: I/dalvikvm(1421): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@44ef6598 on null that has not been deactivated or closed
09-04 15:48:38.863: I/dalvikvm(1421):   at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)
09-04 15:48:38.873: I/dalvikvm(1421):   at dalvik.system.NativeStart.run(Native Method)

CODE THAT ITS COMPLAINING ABOUT

public CCTrackLocation getTrackLocationForID(int id) {
        CCTrackLocation trackLocation = new CCTrackLocation();

        String selectQuery = "SELECT * FROM "+TABLE_TRACK_LOCATION+" WHERE \"id\" = "+ String.valueOf(id);

        SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(selectQuery,null);
        if (cursor.moveToFirst()) {
            do {
                trackLocation.setID(cursor.getInt(0));
                trackLocation.segmentID = cursor.getInt(1);
                trackLocation.timestamp = cursor.getDouble(2);
                trackLocation.latitude = cursor.getDouble(3);
                trackLocation.longitude = cursor.getDouble(4);
                trackLocation.altitude = cursor.getDouble(5);
                trackLocation.velocity = cursor.getDouble(6);
                trackLocation.heading = cursor.getDouble(7);
                trackLocation.haccuracy = cursor.getDouble(8);
                trackLocation.vaccuracy = cursor.getDouble(9);
            }while(cursor.moveToNext());
        }

        cursor.close();
        db.close();

        return trackLocation;
    }

Any help would be hugely appreciated.

  • 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-11T03:33:23+00:00Added an answer on June 11, 2026 at 3:33 am

    To solve this problem here is what I did.

    1. Only opened and closed the database once. Even if I opened and closed the database every time I used it, sometimes it wasn’t quick enough I think and hence I got the errors.
    2. Closed the cursor after everytime I used it and had finished with it. This sorted the problem.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before I ask this question I must point out that I have tried to
Before I ask the question let me state that I have attempted to google
I don't know if this question has been ask before. But I have a
Before you guys ask, yes I've searched online for the answer, but everything I
I tried to ask this question before but I guess I didnt explain myself
Let me explain the situation before I ask the question. I have a site,
I thought I'd ask before I try. I'm guessing that I need to have
Before I ask my question can I please ask not to get a lecture
I've looked around, and I do see previous questions where people ask about Date/Time
I have ask similar question before : Java String Memory Leak But I was

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.