alandarev alandarev - 9 months ago 31
Java Question

Cursor.moveToNext without moveToFirst

Will the next code work as expected?

Cursor c = db.query(tableName, requestedColumns, condition,
conditionParams, null, null, sortOrder);
while(c.moveToNext()) {
//do stuff with rows

The examples I found so far suggest calling
prior looping, but is it really necessary?


Yes, it will work, moveToNext actually call moveToFirst