Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Created April 4, 2013 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evernotegists/5313726 to your computer and use it in GitHub Desktop.
Save evernotegists/5313726 to your computer and use it in GitHub Desktop.
int latestUpdateCount = ... // Persist this value
// Each time you want to check for new and updated notes...
SyncState currentState = noteStore.getSyncState();
int currentUpdateCount = currentState.getUpdateCount();
if (currentUpdateCount > latestUpdateCount) {
// Something in the account has changed, so search for notes
NotesMetadataList newNotes = noteStore.findNotesMetadata( ... );
// Do something with the notes you found...
for (NoteMetadata note : newNotes.getNotes()) {
// ...
}
// Keep track of the new high-water mark
latestUpdateCount = currentSyncState.getUpdateCount();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment