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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:52:03+00:00 2026-06-15T09:52:03+00:00

i have a budget application and while im trying to get infromation out of

  • 0

i have a budget application and while im trying to get infromation out of my SQLite database i keep getting IllegalStateExpeaction error and i cant find out why. here is my code its at line Memos.add(i.getString(1)); that the error happens

public List<String> getMemo(List<String> expeances) {
            // TODO Auto-generated method stub
            List<String> Memos = new ArrayList<String>();
            for(String exp: expeances)
            {
                Cursor i = ourDatabase.query(DATABASE_TABLE4, new String[]{KEY_MEMO},KEY_DATE+" = '"+exp+"'", null, null, null, null,null);

                if(i.getCount()>0)
                {
                    if(i.moveToFirst())
                    {
                        do 
                        {
                            Memos.add(i.getString(1));
                        } 
                        while (i.moveToNext());
                    }
                }
            }

            if (Memos.size()>0)
            {
                return Memos;
            }
            else
            {
                return null;
            }
        }

here is my logcat

 12-05 10:49:46.058: E/AndroidRuntime(12980): FATAL EXCEPTION: main
        12-05 10:49:46.058: E/AndroidRuntime(12980): java.lang.RuntimeException: Unable to start activity ComponentInfo{budget.app/budget.app.ReviewBudget}: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.os.Handler.dispatchMessage(Handler.java:99)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.os.Looper.loop(Looper.java:137)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread.main(ActivityThread.java:4745)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at java.lang.reflect.Method.invokeNative(Native Method)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at java.lang.reflect.Method.invoke(Method.java:511)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at dalvik.system.NativeStart.main(Native Method)
        12-05 10:49:46.058: E/AndroidRuntime(12980): Caused by: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.database.CursorWindow.nativeGetString(Native Method)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.database.CursorWindow.getString(CursorWindow.java:434)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at budget.app.BudgetDB.getMemo(BudgetDB.java:511)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at budget.app.ReviewBudget.loadSpinnerData(ReviewBudget.java:58)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at budget.app.ReviewBudget.onCreate(ReviewBudget.java:51)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.Activity.performCreate(Activity.java:5008)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
        12-05 10:49:46.058: E/AndroidRuntime(12980):    ... 11 more
  • 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-15T09:52:04+00:00Added an answer on June 15, 2026 at 9:52 am

    Your Cursor projection has only one column KEY_MEMO

    but you are trying to access second column with

    i.getString(1)
    

    use

    i.getString(0)
    

    instead

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

Sidebar

Related Questions

I'm trying to design database structure for personal finance application. Basically I'll have Transactions
I am getting a bitmap size exceeds VM budget error. I have read that
I have big issues in tracing down 'bitmap size exceeds VM budget' error. I
In my application, I have a class called Budget. The budget can be of
I currently have an application that for a set of parameters (location, category, budget,
I'm creating a budget application with javascript. I have to let javascript do most
I'm working on my first android app and have an SQLite database set up
I am getting the 'java.lang.OutOfMemoryError: bitmap size exceeds VM budget' error... What I am
In my web application I have an input field called Budget where users enter
In my application I have to retrieve data from a database. My requirement is

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.