java.lang.IllegalStateException

tip

The cursor might not be initalized.


rafaelrafael
tip

You expected a file in the SD card or internal memory, but you have to deal with a file from Google drive.

tip

In cause your problem comes because of mediastore, you have to try changing Albums.ALBUM_ID, to Albums._ID

tip

Check if there's no missing comma or semicolon in your sql declarations.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • SQL Error IllegalStateException
    via Stack Overflow by Alex
    ,
  • Sqlite read causes IllegalstateException
    via Stack Overflow by Sushant kumar
    ,
    • java.lang.IllegalStateException: Could not execute method for android:onClick at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:289) at android.view.View.performClick(View.java:5198) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284) ... 9 more 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. at android.database.CursorWindow.nativeGetString(Native Method) at android.database.CursorWindow.getString(CursorWindow.java:438) at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51) at listy.naive.com.listy.MainActivity.updateUI(MainActivity.java:102) at listy.naive.com.listy.Dialog.Add_task(Dialog.java:58) ... 11 more

    Users with the same issue

    Unknown UserUnknown User
    2718 times, last one,
    justCodeitjustCodeit
    14 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    harshaharsha
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    65 more bugmates