Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Created March 14, 2013 23:58
Show Gist options
  • Save evernotegists/5166377 to your computer and use it in GitHub Desktop.
Save evernotegists/5166377 to your computer and use it in GitHub Desktop.
public void createNote(String title, String content) throws TTransportException {
if (mEvernoteSession.isLoggedIn()) {
Note note = new Note();
note.setTitle(title);
note.setContent(EvernoteUtil.NOTE_PREFIX + content + EvernoteUtil.NOTE_SUFFIX);
mEvernoteSession.getClientFactory().createNoteStoreClient().createNote(note, new OnClientCallback<Note>() {
@Override
public void onSuccess(final Note data) {
Toast.makeText(getApplicationContext(), data.getTitle() + " has been created", Toast.LENGTH_LONG).show();
}
@Override
public void onException(Exception exception) {
Log.e(LOGTAG, "Error creating note", exception);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment