tags:

views:

25

answers:

1

My user can flick through a set of records. I save the last seen record _ID in Preferences, so that they can start off from where they left when they access the application next time.

The cursor that I have extracts _ID field too. However, I don't know how to move cursor to that particular row. The following functions of the cursor need a specific postion to go to :-

moveToPosition(int position)
move(int offset)

The _ID may not be sequential (due to deletes etc).

Any way to do this?

A: 

Can you just have two queries, one for NextEmployee

SELECT MIN(RecordId) WHERE RecordId > currentRecordId

and one for PreviousEmployee

SELECT MAX(RecordId) WHERE RecordId < currentRecordId

and then call moveToPosition with the results?

I'm also confused as to why you're using a cursor, why don't you just fetch based off the recordId?

Mike M.
OceanBlue