Search in sources :

Example 6 with LinkedNotebook

use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.

the class NoteRef method loadLinkedNotebook.

/**
 * @return The linked notebook if this is a linked note.
 * @see #isLinked()
 */
public LinkedNotebook loadLinkedNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    if (!mLinked) {
        return null;
    }
    EvernoteNoteStoreClient noteStore = NoteRefHelper.getSession().getEvernoteClientFactory().getNoteStoreClient();
    if (noteStore == null) {
        return null;
    }
    List<LinkedNotebook> linkedNotebooks = noteStore.listLinkedNotebooks();
    for (LinkedNotebook linkedNotebook : linkedNotebooks) {
        if (linkedNotebook.getGuid().equals(mNotebookGuid)) {
            return linkedNotebook;
        }
    }
    return null;
}
Also used : LinkedNotebook(com.evernote.edam.type.LinkedNotebook) EvernoteNoteStoreClient(com.evernote.client.android.asyncclient.EvernoteNoteStoreClient)

Aggregations

LinkedNotebook (com.evernote.edam.type.LinkedNotebook)6 Notebook (com.evernote.edam.type.Notebook)4 NoteFilter (com.evernote.edam.notestore.NoteFilter)2 SharedNotebook (com.evernote.edam.type.SharedNotebook)2 EvernoteSession (com.evernote.client.android.EvernoteSession)1 EvernoteNoteStoreClient (com.evernote.client.android.asyncclient.EvernoteNoteStoreClient)1