Is it possible to use 2 different cursors for selecting table :
this for a table1
Cursor b = myDbHelper.getSchoolType();
String def = b.getString(0);
and this for another table
c = myDbHelper.getAllSchoolData();
String abc = c.getString(0);
I try to retrieve data from two table useing two cursor but it show error :
android.database.CursorIndexOutOfBoundsException : Index -1 requested, with a size of 2
please help…
thanks for all kinds of answer
By default the cursor pointer points to the position before the first entry (row), so you need to move it to a proper position before you can read data from it. For example move to the first entry:
There are similar methods like moveToNext(), moveToLast() etc, see the reference page for more.