Created
April 4, 2013 20:06
-
-
Save evernotegists/5313726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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