Skip to content Skip to sidebar Skip to footer

Illegalstateexception Cursor Error

Sorry for the repeat Question.but I try to make many way doesn't work In applecation,In the first round, it can push through Activity. But back then it was a mistake. SQLiteDatabas

Solution 1:

Check the return value of

if (!mCursor.moveToFirst()) {
   Log.e(TAG, "Couldn't move to first");
   // do something here if move failed 
}

which you are ignoring now and tells you whether the move succeeded.

Solution 2:

Fix:

  1. Try to position cursor by moveToFirst before reading data from it.

  2. Close the cursor after if ( c.moveToFirst()) {}

  3. check for null.e,g; if (c != null && c.moveToFirst()) {}

  4. check for count.e,g; (c != null && c.getCount() >0 && c.moveToFirst()){}

Post a Comment for "Illegalstateexception Cursor Error"