alandarev alandarev - 1 year ago 84
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?

Answer Source

Yes, it will work, moveToNext actually call moveToFirst

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download