Refactors CursorAdapter to return final item index for querying db.