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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:33:16+00:00 2026-05-26T17:33:16+00:00

I hope someone can help me out with this. I can’t reproduce this error

  • 0

I hope someone can help me out with this. I can’t reproduce this error but am receiving a huge amount of crash reports from it. Below is the stack trace and relevant code. I thought adding “cursor.close();” would solve the problem but it did not. Can anyone figure out what is going on? Line 187 is mDbAdapter.close();

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.companionfree.WLThemeViewer/com.companionfree.WLThemeViewer.Viewer}: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
at android.app.ActivityThread.access$2500(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
at android.database.sqlite.SQLiteDatabase.dbclose(Native Method)
at android.database.sqlite.SQLiteDatabase.onAllReferencesReleased(SQLiteDatabase.java:323)
at android.database.sqlite.SQLiteDatabase.close(SQLiteDatabase.java:886)
at android.database.sqlite.SQLiteOpenHelper.close(SQLiteOpenHelper.java:191)
at com.companionfree.WLThemeViewer.DbAdapter.close(DbAdapter.java:163)
at com.companionfree.WLThemeViewer.Viewer.getNavData(Viewer.java:178)
at com.companionfree.WLThemeViewer.Viewer.onCreate(Viewer.java:65)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
... 11 more

Source:

private void getNavData() {
    mDbAdapter.open();
    //      mNav = MainActivity.mDbAdapter.getNav(mMode);
    //      startManagingCursor(mNav);
    Cursor cursor = mDbAdapter.getNav(mMode);

    int i=0;
    if (!(mMode==MainActivity.MODE_FAVORITE_CREATORS)) {
        mNav2 = new int[cursor.getCount()];
        while (cursor.moveToNext()) {

            String name = cursor.getString(cursor.getColumnIndexOrThrow(DbAdapter.KEY_NAME));
            mNav2[i] = mDbAdapter.getPrimaryRowId(name);

            i++;
        }
    } else {        
        int[] temp = new int[9999];
        while (cursor.moveToNext()) {
            String creatorName = cursor.getString(cursor.getColumnIndexOrThrow(DbAdapter.KEY_NAME));
            Cursor creatorThemes = mDbAdapter.getCreatorThemes(creatorName);
            while (creatorThemes.moveToNext()) {
                String name = creatorThemes.getString(creatorThemes.getColumnIndexOrThrow(DbAdapter.KEY_NAME));
                temp[i] = mDbAdapter.getPrimaryRowId(name);
                i++;

            }
 creatorThemes.close();
        }
        mNav2 = new int[i];
        for (int c=0;c<mNav2.length;c++) {
            mNav2[c] = temp[c];
        }
    }
    cursor.close();
    mDbAdapter.close();
}

DbAdapter.java

public void close() {
    mDbHelper.close();
}

Edit: I tried the first solution and updated it in the market. Here is the most recent crash report:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.companionfree.WLThemeViewer/com.companionfree.WLThemeViewer.Viewer}: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
at android.app.ActivityThread.access$2300(ActivityThread.java:126)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4633)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unable to close due to unfinalised statements
at android.database.sqlite.SQLiteDatabase.dbclose(Native Method)
at android.database.sqlite.SQLiteDatabase.onAllReferencesReleased(SQLiteDatabase.java:322)
at android.database.sqlite.SQLiteDatabase.close(SQLiteDatabase.java:990)
at android.database.sqlite.SQLiteOpenHelper.close(SQLiteOpenHelper.java:191)
at com.companionfree.WLThemeViewer.DbAdapter.close(DbAdapter.java:163)
at com.companionfree.WLThemeViewer.Viewer.getNavData(Viewer.java:179)
at com.companionfree.WLThemeViewer.Viewer.onCreate(Viewer.java:65)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
... 11 more

As requested in the comments

    public int getPrimaryRowId(String name) {
        Cursor cursor =  mDb.query(TABLE_THEMES_V2, new String[] {KEY_ROWID,KEY_NAME}, 
                KEY_NAME + " = '" + name +"'", null, null, null, null);
        cursor.moveToFirst();
        return Integer.parseInt(cursor.getString(cursor.getColumnIndexOrThrow(KEY_ROWID)));
    }
  • 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-26T17:33:17+00:00Added an answer on May 26, 2026 at 5:33 pm

    You’re creating new cursors in a loop (creatorThemes) and never cleaning any of them up

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

Sidebar

Related Questions

Hope someone can help me out with this problem I am having. I just
I hope someone can help me! I'm getting this error when sending OSC messages:
I hope someone can help me out with this. I'd like to measure sorting
Hi hope someone can help out with this one: What I basically want is
Hope someone can help me out of this issue. Im trying to get data
I really hope someone here can help out with this. I'm using Magento 1.6.1.0
I hope someone here can help me see where this error is coming from.
I have been trying to figure this out for days. Hope someone can help.
Hope someone can help me out with this one ! I have a sql
my SQL skills aren't strong enough to figure this out, hope someone can help.

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.