//row --> 2
int row = mCursor.getCount();
for (int i = 0; i < row; i++) {
if (mCursor.moveToPosition(i)){
int val = mCursor.getInt(mCursor.getColumnIndexOrThrow(UTILI_COLLOC_ID_UTILI))
}
}
I don't understand because I have 2 rows in my query. But when I want to read the seconde row with "mCursor.moveToPosition(i)", so it's false...Why ?
I think you can just safely use
while(mCursor.moveToNext()) {
// code
}
instead of for looping
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With