I'm trying to understand why they would start the cursor before the first position in a row and why it would end after the last position. Is there an inherit advantage to doing it this way?
For example:
public abstract int getPosition ()
Since: API Level 1 Returns the current position of the cursor in the row set. The value is zero-based. When the row set is first returned the cursor will be at position -1, which is before the first row. After the last row is returned another call to next() will leave the cursor past the last entry, at a position of count().
returns the current cursor position.
Thank you.
Because a Cursor
isn't guaranteed to be populated with rows. If you got a Cursor
back from a database with 0 rows, the initial position being at 0 doesn't make sense since there isn't a row at position 0.
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