public class NoteTypeListTask implements AsyncTaskIF {
private EvernoteUtil util = EvernoteUtil.getInstance();
- //private NoteList noteList;
+ // private NoteList noteList;
private WeakReference<NoteTypeListActivity> activityRef;
private EvernoteUtil.Error errorCode = null;
private List<INoteItem> list = null;
private int noteItemType;
-
+
public NoteTypeListTask(NoteTypeListActivity activity, int noteItemType) {
activityRef = new WeakReference<NoteTypeListActivity>(activity);
this.noteItemType = noteItemType;
synchronized (util) {
try {
EvernoteUtil util = EvernoteUtil.getInstance();
- switch (noteItemType){
+ switch (noteItemType) {
case Constant.NOTE_ITEM_TYPE_NOTE_BOOK:
List<Notebook> noteList = util.getNoteBookList();
- list = util.toNoteItemFromNoteBook(noteList);
+ if (noteList != null) {
+ list = util.toNoteItemFromNoteBook(noteList);
+ }
break;
case Constant.NOTE_ITEM_TYPE_TAG:
List<Tag> tagList = util.getTagList();
- list = util.toNoteItemFromTag(tagList);
+ if (tagList != null) {
+ list = util.toNoteItemFromTag(tagList);
+ }
break;
default:
break;
return 0;
}
-// public NoteList getNoteList() {
-// return noteList;
-// }
+ // public NoteList getNoteList() {
+ // return noteList;
+ // }
public EvernoteUtil.Error getErrorCode() {
return errorCode;