Книга: Beginning Android

Position

Position

Cursor instances have a built-in notion of position, akin to the Java Iterator interface. To get to the various rows, you can use:

• moveToFirst() to move to the first row in the result set or moveToLast() to move to the last row in the result set

• moveToNext() to move to the next row and determine if there is yet another row to process (moveToNext() returns true if it points to another row after moving, false otherwise)

• moveToPrevious() to move to the previous row, as the opposite to moveToNext()

moveToPosition() to move to a specific index, or move() to move to a relative position plus or minus from your current position

• getPosition() to return your current index

• a whole host of condition methods, including isFirst(), isLast(), isBeforeFirst(), and isAfterLast()

Оглавление книги

Оглавление статьи/книги

Генерация: 0.613. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз